---
name: "GetMessageW"
section: "3w"
platform: "linux"
package: "wine-doc"
version: "0.0.981018-1.1"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/GetMessageW"
---

# 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)](/SetDoubleClickTime/3w.md), [GetDoubleClickTime(3w)](/GetDoubleClickTime/3w.md), [PeekMessageA(3w)](/PeekMessageA/3w.md), [PeekMessageW(3w)](/PeekMessageW/3w.md), [GetMessageA(3w)](/GetMessageA/3w.md), [PostMessageA(3w)](/PostMessageA/3w.md), [PostMessageW(3w)](/PostMessageW/3w.md), [PostThreadMessageA(3w)](/PostThreadMessageA/3w.md), [SendMessageA(3w)](/SendMessageA/3w.md), [SendMessageW(3w)](/SendMessageW/3w.md), [SendMessageTimeoutA(3w)](/SendMessageTimeoutA/3w.md), [SendMessageTimeoutW(3w)](/SendMessageTimeoutW/3w.md), [WaitMessage(3w)](/WaitMessage/3w.md), [MsgWaitForMultipleObjects(3w)](/MsgWaitForMultipleObjects/3w.md), [TranslateMessage(3w)](/TranslateMessage/3w.md), [DispatchMessageA(3w)](/DispatchMessageA/3w.md), [DispatchMessageW(3w)](/DispatchMessageW/3w.md), [RegisterWindowMessageA(3w)](/RegisterWindowMessageA/3w.md), [RegisterWindowMessageW(3w)](/RegisterWindowMessageW/3w.md), [GetTickCount(3w)](/GetTickCount/3w.md), [InSendMessage(3w)](/InSendMessage/3w.md), [BroadcastSystemMessage(3w)](/BroadcastSystemMessage/3w.md), [SendNotifyMessageA(3w)](/SendNotifyMessageA/3w.md), [SendMessageCallbackA(3w)](/SendMessageCallbackA/3w.md)
