Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CWnd::PostMessage
Collapse the table of content
Expand the table of content

CWnd::PostMessage

Places a message in the window's message queue and then returns without waiting for the corresponding window to process the message.

BOOL PostMessage(
   UINT message,
   WPARAM wParam = 0,
   LPARAM lParam = 0 
);

Parameters

message
Specifies the message to be posted.
wParam
Specifies additional message information. The content of this parameter depends on the message being posted.
lParam
Specifies additional message information. The content of this parameter depends on the message being posted.

Return Value

Nonzero if the message is posted; otherwise 0.

Remarks

Messages in a message queue are retrieved by calls to the GetMessage or PeekMessage Windows function.

The Windows PostMessage function can be used to access another application.

Example

See the example for AfxGetMainWnd.

See Also

CWnd Overview | Class Members | Hierarchy Chart | GetMessage | PeekMessage | PostMessage | PostThreadMessage | CWnd::SendMessage

Show:
© 2015 Microsoft