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. MDI non-themed max/min boxes

MDI non-themed max/min boxes

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
6 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.
  • P Offline
    P Offline
    picazo
    wrote on last edited by
    #1

    Hello. When creating a MDI application (with MFC AppWizard VC++ 6.0) you have the choice of excluding the maximize/minimize boxes for the child frames. When creating my MDI app, I chose to not have the maximize/minimize boxes, but to have the child frames start in 'maximize mode'. However, when the child frames are viewed in 'maximized mode', the non-themed minimize and maximize buttons are still drawn. Is there a way to remove or at least disable the non-themed maximize/minimize buttons? ----------------- Genaro

    O 1 Reply Last reply
    0
    • P picazo

      Hello. When creating a MDI application (with MFC AppWizard VC++ 6.0) you have the choice of excluding the maximize/minimize boxes for the child frames. When creating my MDI app, I chose to not have the maximize/minimize boxes, but to have the child frames start in 'maximize mode'. However, when the child frames are viewed in 'maximized mode', the non-themed minimize and maximize buttons are still drawn. Is there a way to remove or at least disable the non-themed maximize/minimize buttons? ----------------- Genaro

      O Offline
      O Offline
      Owner drawn
      wrote on last edited by
      #2

      You can remove WS_MAXIMIZEBOX and WS_MINIMIZEBOX from the concerned window's style.

      BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
      {
      //Modify the Window class or styles here by modifying the CREATESTRUCT cs

      `cs.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX);`
      if( !CMDIChildWnd::PreCreateWindow(cs) )
      	return FALSE;
      
      return TRUE;
      

      }

      Jesus Loves:rose:

      --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

      P 1 Reply Last reply
      0
      • O Owner drawn

        You can remove WS_MAXIMIZEBOX and WS_MINIMIZEBOX from the concerned window's style.

        BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
        {
        //Modify the Window class or styles here by modifying the CREATESTRUCT cs

        `cs.style&=~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX);`
        if( !CMDIChildWnd::PreCreateWindow(cs) )
        	return FALSE;
        
        return TRUE;
        

        }

        Jesus Loves:rose:

        --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

        P Offline
        P Offline
        picazo
        wrote on last edited by
        #3

        I tried that in the BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) function. However, that only removes the boxes if the child frame is not in 'maximized mode'. What function should I edit/override to also remove the non-themed buttons (those show when in maximized mode)? Thank you very much, ----------------- Genaro

        O 1 Reply Last reply
        0
        • P picazo

          I tried that in the BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) function. However, that only removes the boxes if the child frame is not in 'maximized mode'. What function should I edit/override to also remove the non-themed buttons (those show when in maximized mode)? Thank you very much, ----------------- Genaro

          O Offline
          O Offline
          Owner drawn
          wrote on last edited by
          #4

          This is going to be dirty... X| Remove WS_SYSMENU style from the window style.

          Jesus Loves:rose:

          --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

          P 1 Reply Last reply
          0
          • O Owner drawn

            This is going to be dirty... X| Remove WS_SYSMENU style from the window style.

            Jesus Loves:rose:

            --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

            P Offline
            P Offline
            picazo
            wrote on last edited by
            #5

            Thank you very much for the help... I am almost there. The only thing is that removing the WS_SYSMENU also removes the [x], which I would like to keep. Is it possible to do that? Thanks, ----------------- Genaro

            O 1 Reply Last reply
            0
            • P picazo

              Thank you very much for the help... I am almost there. The only thing is that removing the WS_SYSMENU also removes the [x], which I would like to keep. Is it possible to do that? Thanks, ----------------- Genaro

              O Offline
              O Offline
              Owner drawn
              wrote on last edited by
              #6

              picazo wrote:

              WS_SYSMENU also removes the [x],

              Yeah that's why I told it's dirty.

              Jesus Loves:rose:

              --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

              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