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. how to maximize window

how to maximize window

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
6 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.
  • H Offline
    H Offline
    hemlat
    wrote on last edited by
    #1

    Hi, I have developed program in which I am creating window.I want to maximize window size before its creation.Can anyone suggest me. Rekha.

    P _ 2 Replies Last reply
    0
    • H hemlat

      Hi, I have developed program in which I am creating window.I want to maximize window size before its creation.Can anyone suggest me. Rekha.

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      If you want to maximize the window call ShowWindow() with SW_MAXIMIZE. Take a look at the docs here. Regards, --Perspx

      H 1 Reply Last reply
      0
      • H hemlat

        Hi, I have developed program in which I am creating window.I want to maximize window size before its creation.Can anyone suggest me. Rekha.

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Override the PreCreateWindow method in the main window class. Add the WS_MAXIMIZE style to the style member of the CREATESTRUCT parameter like so.

        cs.style |= WS_MAXIMIZE

        «_Superman_» I love work. It gives me something to do between weekends.

        H 1 Reply Last reply
        0
        • _ _Superman_

          Override the PreCreateWindow method in the main window class. Add the WS_MAXIMIZE style to the style member of the CREATESTRUCT parameter like so.

          cs.style |= WS_MAXIMIZE

          «_Superman_» I love work. It gives me something to do between weekends.

          H Offline
          H Offline
          hemlat
          wrote on last edited by
          #4

          Hi, I have overriden PreCreateWindow like this.But I am unable to create maximized window.

          BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
          {
          if( !CFrameWnd::PreCreateWindow(cs) )
          return FALSE;
          cs.style &= ~FWS_ADDTOTITLE;
          cs.style |= WS_MAXIMIZE;
          return TRUE;
          }

          1 Reply Last reply
          0
          • P Perspx

            If you want to maximize the window call ShowWindow() with SW_MAXIMIZE. Take a look at the docs here. Regards, --Perspx

            H Offline
            H Offline
            hemlat
            wrote on last edited by
            #5

            Hi, I used ShowWindow(SW_MAXIMIZE) in PreCreateWindow function like this.But I am unable to create maximized window.

            BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
            {
            f( !CFrameWnd::PreCreateWindow(cs) )
            return FALSE;
            cs.style &= ~FWS_ADDTOTITLE;
            ShowWindow(SW_MAXIMIZE);

            return TRUE;
            

            }

            H 1 Reply Last reply
            0
            • H hemlat

              Hi, I used ShowWindow(SW_MAXIMIZE) in PreCreateWindow function like this.But I am unable to create maximized window.

              BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
              {
              f( !CFrameWnd::PreCreateWindow(cs) )
              return FALSE;
              cs.style &= ~FWS_ADDTOTITLE;
              ShowWindow(SW_MAXIMIZE);

              return TRUE;
              

              }

              H Offline
              H Offline
              hemlat
              wrote on last edited by
              #6

              Hi, I am able to create maximized window.I added ShowWindow(SW_MAXIMIZE) in OnCreate function.Thanks for your reply

              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