BOOL AtlWaitWithMessageLoop( HANDLE hEvent );
Return Value
Returns TRUE if the object has been signaled.
Parameters
hEvent
[in] The handle of the object to wait for.
Remarks
Waits for the object to be signaled, meanwhile dispatching window messages as needed. This is useful if you want to wait for an object's event to happen and be notified of it happening, but allow window messages to be dispatched while waiting.