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);}
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);
}
((CMDIChildWnd*)GetParentFrame())->MDIMaximize();
void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus)
{
CMDIChildWnd::OnShowWindow(bShow, nStatus);
ShowWindow(SW_SHOWMAXIMIZED);
}
{
// TODO: Modify this function to change how the frame is activated. // 打开的第一个窗口要最大化
if (GetParent()->GetWindow(GW_CHILD) == this)
{
nCmdShow = SW_SHOWMAXIMIZED;
}
CXTMDIChildWnd::ActivateFrame(nCmdShow);}
ndy_w(carpe diem) 方法只能最大化