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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. removing the Main Frame title bar in a SDI

removing the Main Frame title bar in a SDI

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 3 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.
  • K Offline
    K Offline
    kdehairy
    wrote on last edited by
    #1

    Does any body knows how to remove the title bar and the menu from the main frame window in an SDI application with MFC ??? k_dehairy

    D G 2 Replies Last reply
    0
    • K kdehairy

      Does any body knows how to remove the title bar and the menu from the main frame window in an SDI application with MFC ??? k_dehairy

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      I think that requires removal of the WS_CAPTION and WS_SYSMENU styles. However, I think there is more to it than this, but I've not tried.


      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      K 1 Reply Last reply
      0
      • D David Crow

        I think that requires removal of the WS_CAPTION and WS_SYSMENU styles. However, I think there is more to it than this, but I've not tried.


        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        K Offline
        K Offline
        kdehairy
        wrote on last edited by
        #3

        there certianly is more, cause I tried that and .. !! Could you be kind and try with me ? k_dehairy

        1 Reply Last reply
        0
        • K kdehairy

          Does any body knows how to remove the title bar and the menu from the main frame window in an SDI application with MFC ??? k_dehairy

          G Offline
          G Offline
          Graham Bradshaw
          wrote on last edited by
          #4

          As luck would have it, I'm working on an application that does exactly that. Happy to share... All code is in the CFrameWnd derived class. to remove the menu and title bar: // remove and destroy the old menu SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); m_hMenuDefault = NULL; // remove the title bar ModifyStyle(WS_CAPTION, 0); to put them back: // restore the title bar ModifyStyle(0, WS_CAPTION); // recreate the menu CMenu menu; menu.LoadMenu(IDR_MAINFRAME); SetMenu(&menu); m_hMenuDefault = menu.GetSafeHmenu();

          K 1 Reply Last reply
          0
          • G Graham Bradshaw

            As luck would have it, I'm working on an application that does exactly that. Happy to share... All code is in the CFrameWnd derived class. to remove the menu and title bar: // remove and destroy the old menu SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); m_hMenuDefault = NULL; // remove the title bar ModifyStyle(WS_CAPTION, 0); to put them back: // restore the title bar ModifyStyle(0, WS_CAPTION); // recreate the menu CMenu menu; menu.LoadMenu(IDR_MAINFRAME); SetMenu(&menu); m_hMenuDefault = menu.GetSafeHmenu();

            K Offline
            K Offline
            kdehairy
            wrote on last edited by
            #5

            I guess I am lucky !! .. thanks very much but.. I put the code in the OnCreate() in the CFrameWnd derived class. It worked with the menu. For the title bar it became not functioning but still here, visible. Why is that? and again thank you --------------------------------- I just tried this now It worked when I made a call to SetWindowPos() but Why is that? k_dehairy

            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