Home > Software engineering >  And "cut" button on the toolbar Settings menu enabled state
And "cut" button on the toolbar Settings menu enabled state

Time:09-27

New single document view in the CXXXView "shear" on the menu in the response message :
Void CXXXView: : OnEditCut ()
{
//code
}

Void CXXXView: : OnUpdateEditCut (CCmdUI * pCmdUI)
{
If (satisfy conditions)
{
PCmdUI - & gt; The Enable (FALSE);
}
}
Now want to OnContextMenu right-click popup menu in the view, "shear" menu and the toolbar ICONS on the grey, study a day, don't know how to deal with,
The original idea: in the view pop-up menu Settings before to meet the conditions, SendMessage (this - & gt; M_hWnd, WM_COMMAND MAKEWPARAM (ID_EDIT_CUT, 0), 0), the code is a pop-up menu, tried it doesn't work,

Just graduated, in the study of MFC, a few years time, forget about, beg you MFC expert help, give a way of thinking,

CodePudding user response:

In OnInitMenuPopup (CMenu * pPopupMenu, UINT nIndex, BOOL bSysMenu) in processing

CodePudding user response:

CEditView GetSelectedText judge selected strings, not empty when enabled

CodePudding user response:

reference 1st floor schlafenhamster response:
in OnInitMenuPopup (CMenu * pPopupMenu, UINT nIndex, BOOL bSysMenu) in processing

Problem has been done, thank you,
See the VC6.0 source code, the WM_INITMENU WM_INITMENUPOPUP, WM_IDLEUPDATECMDUI news figure it out,
  • Related