Is there a way to handle all Windows messages while the UI thread is waiting in WaitHandle or another threading primitive?
I understand that this can create very dirty reconnecting issues; I still want to do this.
EDIT : The wait occurs in the middle of a complex function that must be run in a user interface thread. Therefore, moving the wait to the background thread is not an option. (Dividing the function into two parts would create a complex and incomprehensible mess)
SLaks source
share