hide menubar
-
Hi! I am writing MFC SDI. The view is to display graphic objects and needed to be wide. I want to hide menubar, I tried GetMenu, but it does not work. If we can get the menubar m_hWnd, we can use ShowWindow, but I don't know how. So is there anyway to hide the menubar? Thanks :) sovann.
-
Hi! I am writing MFC SDI. The view is to display graphic objects and needed to be wide. I want to hide menubar, I tried GetMenu, but it does not work. If we can get the menubar m_hWnd, we can use ShowWindow, but I don't know how. So is there anyway to hide the menubar? Thanks :) sovann.
Here is a code snipet from MSDN ... maybe you can use this to remove the menu and add it back when required. This code is written in CMainFrame
// Remove and destroy the old menu. SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); // Load the new menu. m_NewMenu.LoadMenu(IDR_SHORT_MENU); ASSERT(m_NewMenu); // Add the new menu SetMenu(&m_NewMenu); // Assign default menu m_hMenuDefault = m_NewMenu.GetSafeHmenu(); // or m_NewMenu.m_hMenu;
-
Here is a code snipet from MSDN ... maybe you can use this to remove the menu and add it back when required. This code is written in CMainFrame
// Remove and destroy the old menu. SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); // Load the new menu. m_NewMenu.LoadMenu(IDR_SHORT_MENU); ASSERT(m_NewMenu); // Add the new menu SetMenu(&m_NewMenu); // Assign default menu m_hMenuDefault = m_NewMenu.GetSafeHmenu(); // or m_NewMenu.m_hMenu;
This code works! Thank you :)