Name

PostMessage

Synopsis

This function simply posts a message to the message queue of one or more threads. After posting the message, the PostMessage function returns; it does not wait for a response to the posted message, as does SendMessage:

Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
		(ByVal hwnd As Long, ByVal wMsg As Long, _
		ByVal wParam As Long, ByVal lParam As Long) As Long

Parameters

hwnd

The window handle that the message is directed to. If this parameter is set to HWND_BROADCAST, the message is posted to all top-level windows in the system. If this parameter is set to NULL, the message is posted to the message queue of the thread in which this function was called.

uMsg

The message identifier.

lParam

The second parameter of the message.

wParam

The first parameter of the message.

Return Value

The return value is nonzero if the function succeeded in posting the message; otherwise, returns a zero 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.