BOOL PeekMessage(
LPMSG lpMsg, // message information
HWND hWnd, // handle to window
UINT wMsgFilterMin, // first message
UINT wMsgFilterMax, // last message
UINT wRemoveMsg // removal options
);
Parameters
lpMsg
[out] Pointer to an MSG structure that receives message information.
hWnd
[in] Handle to the window whose messages are to be examined. The window must belong to the current thread.
If hWnd is NULL, PeekMessage retrieves messages for any window that belongs to the current thread. If hWnd is INVALID_HANDLE_VALUE, PeekMessage retrieves messages whose hWnd value is NULL, as posted by the PostThreadMessage function.
wMsgFilterMin
[in] Specifies the value of the first message in the range of messages to be examined. Use WM_KEYFIRST to specify the first keyboard message or WM_MOUSEFIRST to specify the first mouse message.
If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed).