Thursday, March 15, 2012

MFC Maximize MDI Child

Hey there,
If you want to have a MDI app in MFC and all your MDI Children to be maximized when they are displayed, just override the ActivateFrame function in CChildFrame like this:
void CChildFrame::ActivateFrame(int nCmdShow)
{
    // Create the child frame window maximized
    nCmdShow = SW_MAXIMIZE;

    CMDIChildWnd::ActivateFrame(nCmdShow);
}

No comments: