Maxim Main Frame and Child Frame

来源:互联网 发布:php记录访问次数及ip 编辑:程序博客网 时间:2024/06/16 17:37

(1) First create a MDI MFC Application.

(2) Make the mainframe maxisize. 

     BOOL CMyFirstApp::InitInstance()

     {

          m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);  //add

     }

(3) Make childframe maxisize.

     void CMyFirstView::OnInitialUpdate()

     {

         GetParentFrame()->ShowWindow(SW_SHOWMAXIMIZED); //add

     }

     或者

    void CChildFrame::ActivateFrame(int nCmdShow)
    {
    // TODO: Add your specialized code here and/or call the base class
       nCmdShow = SW_SHOWMAXIMIZED ;  //add
      CMDIChildWnd::ActivateFrame(nCmdShow);
    }