如何隐藏菜单? lpszMenuName

时间:2010-02-18 15:59:36

标签: c++ windows visual-studio-2008

我设法用这段代码制作菜单并使用Visual Studio 2008:

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

但是如何通过按下我选择的按钮来隐藏菜单?有ShowWindow()函数,但它不适用于菜单...所以我用什么功能来隐藏菜单......?

1 个答案:

答案 0 :(得分:1)

我认为你可以这样做:

// save the menu
HMENU hMenuOld = GetMenu(hWnd);
// hide the menu
SetMenu(hWnd, NULL);
// show the menu
SetMenu(hWnd, hMenuOld);
相关问题