Handling window size at startup

Hi

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.

Thanks
Madhavi.
osi-sysAsked:
Who is Participating?
 
AndyAinscowFreelance programmer / ConsultantCommented:
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
      m_pMainWnd->UpdateWindow();

      return TRUE;
}
0
 
osi-sysAuthor Commented:
Thanks AndyAinscow...my problem is solved...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.