[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'InterfaceBase' (#lcl)

# TWidgetSet.PeekMessage

Checks the thread's message queue for a message.

## Declaration

Source position: winapih.inc line 210

`public function TWidgetSet.PeekMessage(`
`var lpMsg: TMsg;`
`Handle: HWND;`
`wMsgFilterMin: UINT;`
`wMsgFilterMax: UINT;`
`wRemoveMsg: UINT`
`):Boolean; virtual;`

## Arguments

`lpMsg` |  | Receives the message.
`Handle` |  | The target window handle of the message. Zero for any window, INVALID_HANDLE_VALUE for thread messages.
`wMsgFilterMin` |  | The lowest message ID to retrieve.
`wMsgFilterMax` |  | The highest message ID to retrieve, zero for all messages.
`wRemoveMsg` |  | PM_REMOVE will remove the message from the queue.