Important: |
---|
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. |
This function returns when one of the specified objects is in the signaled state, or when the time-out interval elapses. This function does not return if there is unread input of the specified type in the queue. It returns only when new input arrives.
DWORD MsgWaitForMultipleObjects( DWORD nCount , LPHANDLE pHandles , BOOL fWaitAll , DWORD dwMilliseconds , DWORD dwWakeMask );
Parameters
Value | Description |
---|---|
QS_ALLEVENTS | An input, WM_TIMER, WM_PAINT, WM_HOTKEY, or posted message is in the queue. |
QS_ALLINPUT | Any message is in the queue. |
QS_HOTKEY | A WM_HOTKEY message is in the queue. |
QS_INPUT | An input message is in the queue. |
QS_KEY | A WM_KEYUP, WM_KEYDOWN, WM_SYSKEYUP, or WM_SYSKEYDOWN message is in the queue. |
QS_MOUSE | A WM_MOUSEMOVE message or mouse-button message (WM_LBUTTONUP, WM_RBUTTONDOWN, and so on). |
QS_MOUSEBUTTON | A mouse-button message (WM_LBUTTONUP, WM_RBUTTONDOWN, and so on). |
QS_MOUSEMOVE | A WM_MOUSEMOVE message is in the queue. |
QS_PAINT | A WM_PAINT message is in the queue. |
QS_POSTMESSAGE | A posted message (other than those just listed) is in the queue. |
QS_SENDMESSAGE | A message sent by another thread or application is in the queue. |
QS_TIMER | A WM_TIMER message is in the queue. |
Return Values
If the function succeeds, the return value indicates the event that caused the function to return. The successful return value is one of the following:
This value is also returned upon the occurrence of a system event that requires the thread's action, such as foreground activation. Therefore, MsgWaitForMultipleObjectscan return even though no appropriate input is available and even if dwWaitMaskis set to 0. If this occurs, call PeekMessageor GetMessageto process the system event before trying the call to MsgWaitForMultipleObjectsagain.
0xFFFFFFFF indicates failure. To get extended error information, call GetLastError.
Remarks
The MsgWaitForMultipleObjectsfunction is implemented as a macro that calls MsgWaitForMultipleObjectsEx, passing 0 in the dwFlagsparameter.
The MsgWaitForMultipleObjectsfunction determines whether the wait criteria have been met. If the criteria have not been met, the calling thread enters an efficient wait state, using very little processor time while waiting for the conditions of the wait criteria to be met.
Before returning, a wait function modifies the state of some types of synchronization objects. Modification occurs only for the object or objects whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one. When fWaitAllis FALSE, and multiple objects are in the signaled state, the function chooses one of the objects to satisfy the wait; the states of the objects not selected are unaffected.
The MsgWaitForMultipleObjectsfunction can specify handles of the following object types in the pHandlesarray:
The QS_POSTMESSAGE flag is cleared when you call GetMessageor PeekMessage, whether or not you are filtering messages.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winbase.h | Msgque.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
MsgWaitForMultipleObjectsEx, WaitForMultipleObjects