开发者

How to hide menu? lpszMenuName

开发者 https://www.devze.com 2022-12-20 18:54 出处:网络
I managed to make the menu with this piece of code and using Visual Studio 2008: WNDCLASSwc; ... wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);

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() 开发者_如何学JAVAfunction, but it doesnt work on menus... so what function i use to hide menu...?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消