Windows Messaging mechanism
Windows is a message-driven operating system.
such as the message wm_paint the form is drawn.
Structure definition:
Message Classification-Send route
The queue message.
Windows maintains a message queue for each program that executes. Taken out by the application itself, such as Wm_timer.
Non-queue messages.
This type of message comes from a specific Windows function, such as the UpdateWindow () function, which sends a WM_PAINT redraw message directly to the form handler function.
Message Classification-Sender
System messages. is a uint constant that is defined in advance.
User messages.
Apply through the RegisterWindowMessage () function.
Sending of messages
PostMessage (), an asynchronous function that is returned directly after it is placed in the queue.
SendMessage (). The synchronization function does not enter the message queue. The run is complete before returning.
Get the message
The API uses the switch case statement.
MFC is encapsulated with message maps. (Nature or API)
Windows Messaging mechanism