The SendMessage and PostMessage functions let applications pass messages to their windows or to the windows of other applications. The PostAppMessage function is a variation on PostMessage that posts a message using the application's module handle rather than a window handle.
The PostMessage function directs Windows to post a message—that is, place the message in an application's message queue. The PostMessage function immediately returns control to the calling application, and any action to be carried out as a result of the message does not occur until the message is read from the queue.
The SendMessage function directs Windows to send a message directly to the given window procedure, bypassing the application's message queue. Windows does not return control to the calling application until the window procedure that receives the message processes the message or returns control as a result of a call to the ReplyMessage function.
When an application transmits a message, it must do so by calling SendMessage if the application relies on the return value of a message. The return value of SendMessage is the same as the value returned by the window procedure that processed the message. PostMessage returns immediately after sending the message, so its return value is only a Boolean value indicating whether the message was successfully placed in the queue and does not indicate how the message was processed.