Skip to content
Search

WindowsApi:PostMessage

lastmod 2018-08-17created 2016-04-081 edits

The SendMessage() function calls the window procedure directly. A message generated by the SendMessage() function is processed immediately at the point the window procedure is called, and the next routine cannot run until that message has been processed. In other words, the SendMessage() function cannot return until the window procedure has processed the message. You can think of this as working the same way as an ordinary function call.

Synopsis

LRESULT PostMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );
  • message: Specifies the message to generate, as an unsigned int type.
  • wParam: Specifies additional information about the message, as a WPARAM type. Defaults to 0.
  • lParam: Specifies additional information about the message, as an LPARAM type. Defaults to 0.

The return value is the result after the message has been processed. The routine executed by the generated message can return a result for that routine, and the returned result value becomes the return value of this function.

SendMessage vs PostMessage

See also