-
May 1st, 2017, 05:36 AM
#1
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.
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.
-
May 1st, 2017, 05:44 AM
#2
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?
Victor Nijegorodov
-
May 1st, 2017, 06:35 AM
#3
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.
-
May 1st, 2017, 06:49 AM
#4
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?
Victor Nijegorodov
-
May 1st, 2017, 07:21 AM
#5
Re: In mfc MDI project the onfilenew restores the existing fullscreen MDI child.
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
-
May 2nd, 2017, 05:07 AM
#6
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|