Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Maximised window on MFC application startup

9 views
Skip to first unread message

Bruce Varley

unread,
Apr 1, 2013, 8:49:38 AM4/1/13
to
MFC application, the window creation function is below. When the program is
run, the window comes up undocked, and I have to maximise it manually. I've
tried many of the other style specifiers, none of them will do that. Is
there something else that I need to do to get the program to startup with a
maximised window? Or is it a Windows thing, rather than the application?
TIA

CMainWindow::CMainWindow()
{
Create (NULL,
"My Program"
,WS_OVERLAPPEDWINDOW,
rectDefault,
NULL,
0
) ;



ScottMcP [MVP]

unread,
Apr 1, 2013, 9:17:41 AM4/1/13
to
MFC uses the CWinApp public member m_nCmdShow to determine the initial window state. You can set it to SW_SHOWMAXIMIZED before you create the window, or you can set it in the CMainFrame OnCreate handler.
0 new messages