Solved: Microsoft Help: IEExe.exe and STA

P

pfurb

Hi.
Thanks for all suggestions.
I have finally solved the problem. The System.Windows.Forms.Timer
fails because of the UI-operations it executes in my program. So the
program crashes when it is being closed.

The solution was to replace the System.Windows.Forms.Timer with an
implementation of SetTimer and KillTimer.
Now it works fine.

....
int monitorTimer = SetTimer(this.Handle, 9999, 1000, 0);
....

/--- Set timer
[System.Runtime.InteropServices.DllImport("user32.dll")]
extern static int SetTimer(System.IntPtr hWnd,System.UInt32
iEvent,System.UInt32 iElapse, int iCallbackMustBeZero);

//--- Kill timer
[System.Runtime.InteropServices.DllImport("user32.dll")]
extern static int KillTimer(System.IntPtr hWnd,int iEvent);

//--- Timer static
static int WM_TIMER = 0x0113;

protected override void WndProc(ref Message m)
{
//--- Check if it is a timer process
if (m.Msg == WM_TIMER)
{
)
base.WndProc(ref m);
}


br/
peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top