WaitOne & Dialog Windows

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

Hi, actually I have two short questions.
1.) I'm trying to find out if a waithandle is set. I use "handle.WaitOne(0,
true);" which just waits for zero milliseconds. Is there a more formal way
of checking the status of a waithandle or is my code correct?

2) Can I call a dialog window or messagebox.show from a different thread
than main ui thread or do I have to use invoking?

Thanks for replies!
 
Pierre,

For your first question, that's pretty much the only way to do it.

As for your second, you can not make the call from another thread
directly. You will have to call the Invoke method to marshal the call to
the UI thread that you want to run the call on (since it will invoke a UI
operation).

Hope this helps.
 
Back
Top