There are two ways to maximize the sub-window, one is when the cchildframe is created, when creating cchildframe, when creating cchildframe:
1. Dynamically create the cchildframe window, the code is as follows:
CcReteContext Context; context.m_pcurrentdoc = pdocument; context.m_pnewdoctemplate = theApp.m_pdoctemplate;
CChildFrame * m_pFrame = new CChildFrame (); context.m_pNewViewClass = RUNTIME_CLASS (CView); if return FALSE (m_pFrame-> LoadFrame (IDR_MAINFRAME, WS_SYSMENU | | WS_MAXIMIZE WS_OVERLAPPEDWINDOW, this, & context)!); M_pFrame-> ShowWindow (SW_SHOWMAXIMIZED); m_pframe-> initialupdateframe (pDocument, true);
2, add a message mapping function in cchildframe, the code is as follows:
void CChildFrame :: ActivateFrame (int nCmdShow) {// TODO: Add your specialized code here and / or call the base class nCmdShow = SW_SHOWMAXIMIZED; CMDIChildWnd :: ActivateFrame (nCmdShow);}