MFC can generally use the ClassWizard Class Wizard to add message and message processing functions, but the user-defined message must be entered manually, now the VC custom message method steps are recorded as follows:
(1) Define a message that uses the # define statement to define the user's own message directly (either in the. h file or in the. cpp file) as follows:
#define Wm_mymessage wm_user+1
(2) Declare the custom message handler function in the. h file as follows:
afx_msg LRESULT onmymessage (WPARAM wp,lparam LP);
and add in the function body declaration of the class
Public:
LRESULT c***::onmymessage (WPARAM wp,lparam LP);
(3) Add a custom message map macro in the. cpp file and add it in the middle of Begin_message_map () and End_message_map ():
On_message (wm_memessage,onmymessage)//Custom message map macros
(4) Continue implementing the OnMyMessage () function in. cpp and add the following code:
LRESULT c***::onmymessage (WPARAM wp,lparam LP)
{
Code to implement function functions
}
Reference: http://www.cnblogs.com/514687800/archive/2013/04/25/3043568.html
"Go" VC custom message