多文档结构(MDI)中如何实现程序刚启动时实现子窗口的最大化显示,并且新建一个子窗口时,也让让子窗口最大化显示。

解决方案 »

  1.   

    定义该函数调用之即可
    AdaptToParent(CWnd *pParent)
    {
    if(pParent == NULL)
       pParent = GetParentFrame(); ASSERT(pParent); CRect Rect;

    pParent->GetClientRect(&Rect);
    pParent->RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery,
    &Rect, NULL);
    pParent->ClientToScreen(&Rect);
    MoveWindow(&Rect);
    }
      

  2.   

    MoveWindow可以最大化吗?这样最简单:在CView::OnInitialUpdate中:
    ((CMDIChildWnd*)GetParentFrame())->MDIMaximize();
      

  3.   

    很简单
    void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus) 
    {
    CMDIChildWnd::OnShowWindow(bShow, nStatus);


    ShowWindow(SW_SHOWMAXIMIZED);
    }
      

  4.   

    void CChildFrame::ActivateFrame(int nCmdShow)
    {
    // TODO: Modify this function to change how the frame is activated. // 打开的第一个窗口要最大化
    if (GetParent()->GetWindow(GW_CHILD) == this)
    {
    nCmdShow = SW_SHOWMAXIMIZED;
    }
    CXTMDIChildWnd::ActivateFrame(nCmdShow);}
      

  5.   

    maojincxj(毛巾) 的方法使得子窗口一出来就最大化,而且有最大最小,正常的属性
    ndy_w(carpe diem)  方法只能最大化