Nuno Nuno - 10 months ago 73
C++ Question

How to hide/collapse main menu in a win32/mfc application

I always been interested on how we can accomplish this (hide/show the main menu using the alt key), and now some applications do this very often. One that really please me is the visual studio 2010 with this plugin:

(firefox also do this, but i think that is in a different way)

Can anyone explain me how this can be achieved or if you known of any sample project that demonstrate this please tell me.

(what i can see in some replies here in stack is that we have to destroy the menu when is to hide and create it when is to show?! but this seems a bit bad solution...)



The SetMenu function lets you add/remove the menu from the window. It does not destroy the menu.

Note that most applications which have the dynamic menu hide/show behavior are not really showing a menu. They're showing a custom control that looks like a menu.