Handling window size at startup

Posted on 2005-05-10
Last Modified: 2013-11-20

I am working in MFC with a SDI application. When the executable is executed from windows explorer by double clicking on it, it gets restore notification and the window appears in RESTORE mode. I want to change this default option, I want it to be in maximized mode for the very first time when it's run.
I don't want to handle in OnSize() handler.

Can any one pls help me in changing this option.

Question by:osi-sys
    LVL 43

    Accepted Solution

    in the OnInitInstance of the app

          // The one and only window has been initialized, so show and update it.
          //m_pMainWnd->ShowWindow(SW_SHOW);  //This is default
          m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);  //*****************Display as maximised window

          return TRUE;

    Author Comment

    Thanks problem is solved...

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    cat dog challenge 18 119
    either24  challenge 19 73
    Line meaning 9 57
    Updating statistics with error notification email in SQL server 4 20
    This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
    Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    This video discusses moving either the default database or any database to a new volume.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now