Well,

the keep alive should be in because I monitor the mouse input through
unmanaged code via delegates. The way I tried like I said aborted
this.
But I recently found the solution or better the solution why this
wasn't working. When using Windows.Forms you have to explicitly invoke
the methods that should do their work in other threads than the UI
thread. And my code did not work because this ist was not static.
I so created a static reference to the Windows.Form in the static
program class (that normally starts the application) and in he Forms
class the static Thread, ThreadStart and a MethodInvoker that calls
the method to be performed (in my case the mouse monitor class) and
itself is called myForm.BeginInvoke(myMethodInvoker). The BeginInvoke
call is in a method that is the argument of ThreadStart.
Last but not least you have to create the Thread in the Form with the
ThreadStart an everything works fine.
Found this somewhere on microsoft.com but can't remember where, didn't
bookmark that.
But thanks for your replies.

cheers

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to