参考:BOOL CCDLabelApp::InitInstance()函数中: // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; // The main window has been initialized, so show and update it. m_nCmdShow = SW_SHOWMAXIMIZED; //最大化主框架 pMainFrame->ShowWindow(m_nCmdShow); pMainFrame->UpdateWindow();
(SW_SHOWMAXIMIZED)
首先将m_pMainWnd->ShowWindow(SW_SHOW);屏蔽
然后:文档应用程序启动时最小化
在应用程序的APP类的InitInstance中添加代码:
m_pMainWnd->ShowWindow(SW_MINIMIZE); 文档应用程序启动时最大化
在应用程序的APP类的InitInstance中添加代码:
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE; // The main window has been initialized, so show and update it.
m_nCmdShow = SW_SHOWMAXIMIZED; //最大化主框架
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();