MFC has more than 200 packaging classes, but in MFC's internal technology is not just a simple package
MFC has a total of six key technologies within the framework of the entire MFC development platform
I. Six key technologies of MFC include:
a). Initialization process for MFC programs
b). Message mapping mechanism
c). Run-Time type identification (RTTI)
d). Dynamic creation
e). Permanent Save
f). Message delivery
The six key technologies are designed to improve development efficiency, and developers can handle most of the window's things simply by making simple changes locally.
Two. Functions of the SendMessage and PostMessage functions
a). Ability to send window messages to the specified window. Can be either in this process window or in other processes
b). Both system internal messages can be sent, the range of message numbers is: 1-wm_user-1)
Example: Wm_lbuttondown, wm_mousemove, etc.
c). Can also send non-system messages (developer-defined messages), the range number is: WM_USER-0X7FFF
D). Under MFC non-system message mapping, when using a macro definition On_message
Three. The difference between the SendMessage and PostMessage functions is:
a). SendMessage is a blocking function, and the PostMessage function is a non-blocking function
The SendMessage is used to invoke the internal program of the specified window until the window program finishes processing and returns
PostMessage is returned immediately after a message is sent to a message queue in a window
b). Two functions with different return values
Lresul SendMessage (HWND hwnd,uint msg,wparam wparam,lparam LPARAM);
BOOL PostMessage (HWND hwnd,uint msg,wparam wparam,lparam LPARAM);
The return value of the SendMessage is the numeric value produced by the message processing result, depending on the message handler function
The return value of the PostMessage is either a success or failure, and generally seldom fails unless the window does not exist
c). To send messages across threads or across processes, it is recommended to use the PostMessage function
Windows Programming (III)