First,. Pop-up menu Fast Production Step 1: The addition of the menu resource is to make a pop-up menu, so you may use the view as popup to add a pop-up menu. It is not recommended to do this, directly use the default The edit method is as follows: Select event If you add an event, select the implementation in the WM_CONTextMenu message, if other controls can be selected, you can see the specific situation, you have played it. Step 3: Specific code as follows cMenu menu; menu.loadmenu (idR_file_list); menu.getsubmenu (0) -> EnableMenuItem (id_add_file, mf_bycommand | mf_disabled | mf_grayed); The above statement is just a menu item is not ash, You can do some menu pop-ups here, menu pop-up, menu.getsubmenu (0) -> TRACKPOPUPMENU (TPM_LEFTALIGN, PTPOS.X, PTPOS.Y, THIS); due to the form of GetSubmenu (0), you can system all pop-ups The menu is completed in a menu resource for easy management.
Second,................................................................................................. .. , Onadd) // message mapping table in the CPP file Begin_Message_MAP
AFX_MSG Void Onadd (WPARAM WPARAM, LPARAM LPARAM); // CPP corresponds to. Hy, find a similar place