在APP类的InitInstance()函数中 // The one and only window has been initialized, so show and update it. m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);//程序界面最大化显示 m_pMainWnd->UpdateWindow();
在MDI工程中,是子窗口最大化: BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; // cs.style &= ~WS_MAXIMIZEBOX; // cs.style &= ~WS_MINIMIZEBOX; cs.style &= ~WS_SYSMENU;//去除系统菜单 cs.style |= WS_MAXIMIZE; return TRUE; }
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);//程序界面最大化显示
m_pMainWnd->UpdateWindow();
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
// cs.style &= ~WS_MAXIMIZEBOX;
// cs.style &= ~WS_MINIMIZEBOX;
cs.style &= ~WS_SYSMENU;//去除系统菜单
cs.style |= WS_MAXIMIZE;
return TRUE;
}
就可以了。SDI和MDI都是一样的
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
nCmdShow = SW_SHOWMAXIMIZED;
CMDIChildWnd::ActivateFrame(nCmdShow);
// ModifyStyleEx(WS_MAXIMIZEBOX,0,SWP_DRAWFRAME);
// ModifyStyleEx(WS_MINIMIZEBOX,0,SWP_DRAWFRAME);
}