1 Attachment(s)
In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
Dear All,
I have a MFC MDI project where in on start a maximised MDI child window is created. Later the user can create more MDI children. It is observed that when more children (12 of them) are created by OnFileNew() the existing maximized MDI child is restored and briefly we see the restored mdi child window on screen.
Is there a way to stop the restoring of the existing maximized MDI child window.
I have got screenshot which shows the problem.
Attachment 34849
Thanks and Regards,
Rakesh
What I have tried:
I have tried creating the new children in hide mode (SW_HIDE). It didnt work. I tried creating the new children in very small size and outside the mdi main frame client area.
I have tried putting the existing window on top
(
Hide Copy Code
pAnimView->SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
)
and then making calls to OnFileNew();
Nothing worked.
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
Could you explain a bit more carefully the "observed" difference in creation of the 12-th and, say, 10-th child?
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
Thanks VictorN
There is no difference in the 10th and 12th call. The window shows in restored size till all OnFileNew gets processed and then the unless it is maximized it remains in restored size. The attached screen shot shows the restored view of the window.
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
Could you post a test project that can reproduce the problem you observed?
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
Quote:
Originally Posted by
VictorN
Could you post a test project that can reproduce the problem you observed?
Thanks Victor,
Will create a test project and upload by tomorrow.
Regards,
Rakesh
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
You can override:
Code:
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
if(your_condition)
nCmdShow = SW_SHOWMAXIMIZED /*SW_RESTORED or whatever*/;
CMDIChildWndEx::ActivateFrame(nCmdShow);
}
and setup the childframe state whatever you want.