I created an SDI application,the view based on CFormView. I want to maximize the mainframe window,once the application starts, I changed the code that added by wizard in InitInstance() function , as following.//m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);Though it is maximized,but there is a flash:Before maximized mainframe was showed, I found it was painted with a small size.
(I did not add any other codes).Why? Would u please help me?!

解决方案 »

  1.   

    在mainframe的oncreate中加入 ShowWindow(SW_MAXIMIZE);不就行了。。
      

  2.   

    不要在InitInstance() 里面做
      

  3.   

    不好意思
    应该是
    void CMainFrame::ActivateFrame(int nCmdShow) 
    { nCmdShow = SW_MAXIMIZE; CFrameWnd::ActivateFrame(nCmdShow);
    }
      

  4.   

    Thanks very much,kingcom_xu(刀是用来杀人的!) !
      

  5.   

    kingcom_xu(刀是用来杀人的!) :That still cause a problem.  First I run the application,the frame is maximized,then I resize the frame,not maximized,and open a document, I find the frame is maximized again.Though I can add a member variable in CMainFrame to identify if ActivateFrame() is called first time, which can resolve the problem.But I don't think it is a good solution. Would u please give me some advice?