Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何隐藏菜单?lpszMenuName_C++_Windows_Visual Studio 2008 - Fatal编程技术网

C++ 如何隐藏菜单?lpszMenuName

C++ 如何隐藏菜单?lpszMenuName,c++,windows,visual-studio-2008,C++,Windows,Visual Studio 2008,我使用这段代码并使用Visual Studio 2008制作了菜单: WNDCLASS wc; ... wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1); ... if(!RegisterClass(&wc)) ... 但是我怎么能只按一个我选择的按钮就隐藏菜单呢?有ShowWindow()函数,但它不适用于菜单。。。那么我用什么函数来隐藏菜单…?我想你可以这样做: // save the menu HMENU hMenuOld = Ge

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

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

但是我怎么能只按一个我选择的按钮就隐藏菜单呢?有ShowWindow()函数,但它不适用于菜单。。。那么我用什么函数来隐藏菜单…?

我想你可以这样做:

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

我想你可以这样做:

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

我自己没有试过,但ShowHidemental(…)可能是您正在寻找的。我自己没有试过,但ShowHidemental(…)可能是您正在寻找的