There are three sources of application messages: hardware messages (peripherals such as mouse and keyboard), postmessage messages, and SendMessage messages, all of which can send message events to driver execution.
The message flow graph is as follows.
The hardware message response process is as follows.
① messages into the system message queue.
② messages are distributed to the application message queue.
The ③ application loops through the message.
The ④ message handler function executes.
PostMessage directly into the above step ②, puts the message in the message queue and returns immediately.
SendMessage directly into the above step ④, Call the message handler function, wait for the function to return after the completion of execution.
Summary of C + + technical issues-10th: similarities and differences between SendMessage and PostMessage in MFC