Name

GetMessage

Synopsis

Retrieves a single message from the message queue of the thread in which this function was called:

Public Declare Function GetMessage Lib "user32" Alias "GetMessageA" _
        (lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, 
        ByVal wMsgFilterMax As Long) As Long

Parameters

lpMsg

A Long pointer to an MSG structure that receives the message.

hwnd

The handle of the window whose messages are to be read from the queue. If this is zero, all messages will be read.

wMsgFilterMin

The minimum message value that is read from the message queue.

wMsgFilterMax

The maximum message value that is retrieved from the message queue. If this value is zero, all messages starting with the wMsgFilterMin value are read from the message queue.

Return Value

If an error occurs, this function will return a -1. If this function processes a WM_QUIT message, it will return a 0. Otherwise, it will return a nonzero value.

Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.