WaitDispatchingMessages
A version of this page is also available for
4/8/2010
This function waits for a for the HANDLE hObject before dispatching messages. While waiting, messages sent to windows on the thread by SendMessage will be processed.
Syntax
DWORD WINAPI WaitDispatchingMessages(
HANDLE hObject,
DWORD dwWait,
HWND hwnd = NULL,
UINT uMsg = 0
);
Parameters
- hObject
Handle of object to wait for.
- dwWait
Time-out interval in milliseconds.
- hwnd
Handle to a window.
- uMsg
Win32 message.
Return Value
If the function succeeds, the return value indicates the event that caused the function to return. If the function fails, the return value is WAIT_FAILED.
The return value on success is one of the following values.
Value | Description |
---|---|
WAIT_ABANDONED |
The specified object is a mutex (mutual exclusion) object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread, and the mutex is set to nonsignaled. |
WAIT_OBJECT_0 |
The state of the specified object is signaled. |
WAIT_TIMEOUT |
The time-out interval elapsed, and the object's state is nonsignaled. |
Remarks
This function enables sent messages to be processed while waiting for a handle to a window.
Use this function to wait for an object to be processed and to perform mutually exclusive operations, consequently avoiding possible deadlocks in objects with windows.
This helper function is similar to the Win32 WaitForSingleObject function.
Requirements
Windows Embedded CE | Windows CE 2.12 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later |