Microsoft Windows CE 3.0  


This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Enables sent messages to be processed while waiting for an event to be signaled or for the indicated time-out to occur.

BOOL WaitMsg(


Optional time-out value, represented in milliseconds. The default is INFINITE.

Return Values

Returns TRUE if the event is signaled, or FALSE if the time-out occurred.


Call CAMMsgEvent::WaitMsgrather than CAMEvent::Waitif you want to block on a time-out or a signaled event and continue to process sent messages. If you do not process messages and another thread sends you a message, deadlock could occur. For example, if you create a thread by way of the Win32 CreateThreadfunction and then block until the thread can initialize, deadlock will occur if the thread sends a message to your window using the Win32 SendMessagefunction. This is because SendMessagedoes not return until the message has been processed. CAMMsgEvent::WaitMsgallows SendMessageto return to the caller by using a Win32 PeekMessageloop to do message processing.