Reference

GetMessageW(3w)

GetMessage32W (USER32.274) Retrieve next message

NAME

GetMessageW - GetMessage32W (USER32.274) Retrieve next message

SYNOPSIS

BOOL32 GetMessageW
(

MSG32 *lpmsg,

HWND32 hwnd,

UINT32 min,

UINT32 max
);

PARAMETERS

MSG32 *lpmsg

Buffer to receive message.

HWND32 hwnd

Restrict to messages for hwnd.

UINT32 min

Minimum message to receive.

UINT32 max

Maximum message to receive.

DESCRIPTION

GetMessage retrieves the next event from the calling thread's queue and deposits it in *lpmsg.

If _hwnd_ is not NULL, only messages for window _hwnd_ and its children as specified by IsChild() are retrieved. If _hwnd_ is NULL all application messages are retrieved.

_Min_ and _max_ specify the range of messages of interest. If min==max==0, no filtering is performed. Useful examples are WM_KEYFIRST and WM_KEYLAST to retrieve keyboard input, and WM_MOUSEFIRST and WM_MOUSELAST to retrieve mouse input.

WM_PAINT messages are not removed from the queue; they remain until processed. Other messages are removed from the queue.

RETURNS

-1 on error, 0 if message is WM_QUIT, nonzero otherwise.

CONFORMANCE

ECMA-234, Win32.

SEE ALSO

SetDoubleClickTime(3w), GetDoubleClickTime(3w), PeekMessageA(3w), PeekMessageW(3w), GetMessageA(3w), PostMessageA(3w), PostMessageW(3w), PostThreadMessageA(3w), SendMessageA(3w), SendMessageW(3w), SendMessageTimeoutA(3w), SendMessageTimeoutW(3w), WaitMessage(3w), MsgWaitForMultipleObjects(3w), TranslateMessage(3w), DispatchMessageA(3w), DispatchMessageW(3w), RegisterWindowMessageA(3w), RegisterWindowMessageW(3w), GetTickCount(3w), InSendMessage(3w), BroadcastSystemMessage(3w), SendNotifyMessageA(3w), SendMessageCallbackA(3w)