I want to call WaitHandle.WaitOne(TimeSpan)
in .NET, but I'm on the STA thread and it pumps messages while waiting. For reasons that are beyond the scope of this question, I need to wait without pumping. How can I wait for a WaitHandle to be signaled without pumping messages?
It seems in some scenarios that WaitHandle.WaitOne
does not pump messages. But it does sometimes for some messages. See these links for more information on that: