Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. hide menubar

hide menubar

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    s o v a n n
    wrote on last edited by
    #1

    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.

    A 1 Reply Last reply
    0
    • S s o v a n n

      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.

      A Offline
      A Offline
      A T I F
      wrote on last edited by
      #2

      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;

      S 1 Reply Last reply
      0
      • A A T I F

        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;

        S Offline
        S Offline
        s o v a n n
        wrote on last edited by
        #3

        This code works! Thank you :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups