试试这个:BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.x=cs.y=0; cs.cx=GetSystemMetrics(SM_CXSCREEN); cs.cy=GetSystemMetrics(SM_CYSCREEN); return TRUE; }
要这样才行: void CMainFrame::ActivateFrame(int nCmdShow) { // TODO: Add your specialized code here and/or call the base class nCmdShow = SW_SHOWMAXIMIZED;
{
cs.style |=WS_MAXIMIZE;
//cs.dwExStyle |=WS_MAXIMIZE;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}我用了上述代码,结果还是一样得效果,当然,app中我也用了最大化设置
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.x=cs.y=0;
cs.cx=GetSystemMetrics(SM_CXSCREEN);
cs.cy=GetSystemMetrics(SM_CYSCREEN); return TRUE;
}
void CMainFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
nCmdShow = SW_SHOWMAXIMIZED;
CFrameWnd::ActivateFrame(nCmdShow);
}ActivateFrame() 为一个重载函数,这样就不会出现闪烁了。