Override
CFrameWnd::ActivateFrame
and pass
SW_SHOWMAXIMIZED
to the base class function.
Code:
class CChildFrame : public CMDIChildWnd
{
public:
virtual void ActivateFrame(int nCmdShow = -1);
};
void CChildFrame::ActivateFrame(int nCmdShow)
{
if (nCmdShow == -1)
{
if(GetNextWindow() == NULL && GetNextWindow(GW_HWNDPREV) == NULL)
{
nCmdShow = SW_SHOWMAXIMIZED;
}
}
CMDIChildWnd::ActivateFrame(nCmdShow);
}
Thanks to
http://www.codeguru.com/forum/showthread.php?t=380988[
^].