views:

106

answers:

1

I managed to make the menu with this piece of code and using Visual Studio 2008:

WNDCLASS    wc; 
...
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);
...
if(!RegisterClass(&wc))
...

But how i can hide the menu by just pressing a button of my choice? There is ShowWindow() function, but it doesnt work on menus... so what function i use to hide menu...?

A: 

I think you can do something like this:

// save the menu
HMENU hMenuOld = GetMenu(hWnd);
// hide the menu
SetMenu(hWnd, NULL);
// show the menu
SetMenu(hWnd, hMenuOld);
Luke