Here is a new View menu that I have added to my software:
My editor (a CDialog) has two modes. This View menu is only application to one of the modes.
At the moment I am simply disabling the menu items like this:
CMenu* pMenu = GetMenu();
if (pMenu != nullptr)
{
pMenu->EnableMenuItem(ID_VIEW_REFRESH, MF_BYCOMMAND | MF_GRAYED);
CMenu* pViewMenu = pMenu->GetSubMenu(3);
if (pViewMenu != nullptr)
pViewMenu->EnableMenuItem(1, MF_BYPOSITION | MF_GRAYED);
}
This works fine. But is there any way to either:
- Disable the actual View menu item on the menu bar?
- Remove / Add the menu as needed?
As the moment the menu is always there and I just disable the items dependant on the active editor mode. It is part of my editor menu in the resources:
POPUP "View"
BEGIN
MENUITEM "Refresh\tF5", ID_VIEW_REFRESH, INACTIVE
POPUP "Zoom", GRAYED
BEGIN
MENUITEM "Zoom In\tCTRL +", ID_ZOOMLEVEL_ZOOMIN
MENUITEM "Zoom Out\tCTRL -", ID_ZOOMLEVEL_ZOOMOUT
MENUITEM SEPARATOR
MENUITEM "400%", ID_ZOOMLEVEL_400
MENUITEM "300%", ID_ZOOMLEVEL_300
MENUITEM "250%", ID_ZOOMLEVEL_250
MENUITEM "200%", ID_ZOOMLEVEL_200
MENUITEM "175%", ID_ZOOMLEVEL_175
MENUITEM "150%", ID_ZOOMLEVEL_150
MENUITEM "125%", ID_ZOOMLEVEL_125
MENUITEM "100%\tCTRL + 0", ID_ZOOMLEVEL_100
MENUITEM "75%", ID_ZOOMLEVEL_75
MENUITEM "50%", ID_ZOOMLEVEL_50
MENUITEM SEPARATOR
MENUITEM "Custom...", ID_ZOOM_CUSTOM
END
END
Is this possible?


