• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

How to make MFC app start NOT maximized.

Hello,
  Im guessing I checked the box to start my app maximized when I initially created it.

Now I don't want that anymore and can't figure out where in the code this is set. I want it to just start up at some default size.

Thanks,
  jer
0
pipe
Asked:
pipe
  • 2
  • 2
1 Solution
 
chensuCommented:
Search all your source files (*.h, *.cpp, *.rc) for WS_MAXIMIZE.
0
 
pipeAuthor Commented:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
      if( !CFrameWnd::PreCreateWindow(cs) )
            return FALSE;
      // TODO: Modify the Window class or styles here by modifying
      //  the CREATESTRUCT cs

      cs.style = WS_OVERLAPPED | WS_CAPTION  
            | WS_THICKFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;


      return TRUE;
}
0
 
basantCommented:
ShowWindow( .. SW_SHOWMAXIMIZED);

Search for SW_SHOWMAXIMIZED,

Most probably you will do in OnInitInstance
0
 
chensuCommented:
I should have told you to search for MAXIMIZE. :-(
0
 
pipeAuthor Commented:
yip, that was it. thanks.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now