PostThreadMessage

  BOOL PostThreadMessage(dwThreadId, uMsg, wParam, lParam)    
  DWORD dwThreadId; /* thread identifier */
  UINT uMsg; /* message to post */
  WPARAM wParam; /* first message parameter */
  LPARAM lParam; /* second message parameter */

The PostThreadMessage function posts (places) a message in the message queue of the given thread and then returns without waiting for the thread to process the message. The thread to which the message is posted retrieves the message by calling the GetMessage or PeekMessage function. The hwnd member of the returned MSG structure is NULL.

Parameters

dwThreadId

Identifies the thread to which the message is posted.

uMsg

Specifies the type of message to be posted.

wParam

Specifies additional message-dependent information.

lParam

Specifies additional message-dependent information.

Return Value

The return value is TRUE if the function is successful or FALSE if an error occurs. To obtain extended error information, use the GetLastError function.

Comments

This function replaces the PostAppMessage function. New Win32 applications should use PostThreadMessage.

See Also

GetMessage, PeekMessage, PostMessage