How to initialize the maximum window?

zhaozj2021-02-16  68

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);}

转载请注明原文地址:https://www.9cbs.com/read-16158.html

New Post(0)