WaitMessage

Syntax

void WaitMessage( )

This function yields control to other applications when an application has no other tasks to perform. The WaitMessage function suspends the application and does not return until a new message is placed in the application's queue.

This function has no parameters.

Return Value

None.

Comments

The GetMessage, PeekMessage, and WaitMessage functions yield control to other applications. These calls are the only way to let other applications run. If your application does not call any of these functions for long periods of time, other applications cannot run.

When GetMessage, PeekMessage, and WaitMessage yield control to other applications, the stack and data segments of the application calling the function may move in memory to accommodate the changing memory requirements of other applications. If the application has stored long pointers to objects in the data or stack segment (that is, global or local variables), these pointers can become invalid after a call to GetMessage, PeekMessage, or WaitMessage.