BEGIN_MESSAGE_MAP (TheClass, BaseClass) macro is used to define its own message map, where theclass is used to specify which class, BashClass specifies the base class, the macro is usually used in (CPP) files and should be placed before the member function definition, macro The use is starting with begin_message_map and adds a macro definition for each message processing function, and finally must end_message_map. For example: BEGIN_MESSAGE_MAP (CHardwareInfoApp, CWinApp) // {! {AFX_MSG_MAP (CHardwareInfoApp) // NOTE - the ClassWizard will add and remove mapping macros here.// DO NOT EDIT what you see in these blocks of generated code //}} AFX_MSGON_COMMAND (Id_help, cwinapp :: onhelp) end_message_map () When using the AppWizard generating program, the programmer must call the AFXENABLECONTROLCONTAINER () function when selecting the ActiveX control. Calling this function in the object's InitInstance function can provide support for the OLE control. ENALBE3DCONTROLS () When connecting to the MFC dynamic link library, call ENALBE3DCONTROLSTATIC () When the static connection to the MFC library is called, the above two functions are used to support the window and control 3-dimensional feeling (and all in InitInstance) Each class is generated by ccmdTarget must provide message clutch to handle the message. At this time, DECLARE_MESSAGE_MAP () must last call CWINAPP * AFXGetApp () returns CWINAPP * AFXGetApp (), which points to the CWINAPP object of the application. CWnd :: Virtual Void DodataExchange (CDATAEXCHANGE * PDX) This function is called by Framework, used to exchange and confirm dialog data. Don't call the function directly, it should be called by the Updatedate member function. The purpose of calling Updatedate is to initialize the control of the dialog or acquire data from the dialog. CWnd :: AFX_MSG Void OnSysCommand (Uint Nid, LPARAM LPARAM); The first parameter is used to determine the type of system command call. If the menu command is selected with a mouse, the LPARAM contains the coordinates of the mouse. The low word contains the coordinates of X, and the high position includes the coordinates of Y. The program framework calls the function when the user selects commands from the control menu or when the user is maximized and minimized. CWnd :: Isiconic () Judgment window is minimized CWnd :: SendMessage (uint message, wparam wparam = 0, lparam lparam = 0) LRESULT SendMessage (HWND HWND, UINT MSG, WPARAM WPARAM, LPARAM LPARA) Both functions It is used to send messages. The WM_ICONERASEBKGND message is sent to a minimized window, and only the window will receive the message when it defines ICON to the window.