Re: Disabling::Popup Menu
Re: Disabling::Popup Menu
@shekar: already check that, but not what Im looking for.
Re: Disabling::Popup Menu
Something like:
Code:
CMenu* pMenu = AfxGetMainWnd()->GetMenu();
if(pMenu != NULL)
pMenu->EnableMenuItem(1, MF_BYPOSITION | MF_GRAYED); // disable second (with index '1') menu
Re: Disabling::Popup Menu
And please don't miss this point:
From MSDN
Quote:
When you change a window menu, the menu bar is not immediately updated. To force the update, call DrawMenuBar.
Re: Disabling::Popup Menu
Good point, Igor!
(Although in my small and fast test the menu item was disabled without DrawMenuBar call, it is still required if some of menus/submenus was removed or added or the whole menu bar).