MFC 9.0 has support for the automaticall and manual hiding of menus. To enable that, SetMenuBarVisibility must be called. This method of class CFrameWnd requires AFX_MBV_DISPLAYONFOCUS to be passed in order to hide the menu automatically and show it only when pressing the ALT key.
However, this only works in SDI applications. In an MDI application calling that for the child frame (derived from CMDIChildWnd) does not have any effect. Trying to call the method with any other parameter than AFX_MBV_KEEPVISIBLE results in an assertion failure, because the mothod is overriden in CMDIFrameWnd:
This feature was designed to not support hiding of menus in MDI applications. One of the reasons for this decision was that it was unclear what should be happening with minimize/restore/close buttons on menu bar associated with the child window. Also most of the MDI apps have complex menus and Vista UX guidelines do not encourage hiding complex menu bars.
Visual C++ Team
Monday, July 09, 2007 7:36 PM
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.