CMDIChildWnd changing size unexpectedly
-
I have a multidoctemplate app, call it MyApp. For the default doc-view-frame of MyAppDoc-MyAppView-CChildFrame, I override the frame ActivateFrame to show the frame maximized. I added another doc-view-frame set, NewDoc-NewView-NewFrame, NewFrame derived from CMDIChildWnd. I override NewFrame ActivateFrame to show it normal. When I create and show a NewDoc object, it displays correctly but now my MapAppView is no longer maximized but cascaded with the NewView object. Why would anything I do with NewView affect anything I had done with MyAppView? I want MyAppView to continue to be maximized but NewView to be normal since I may create a lot of NewView objects and I want them cascaded when they are first shown. Thanks in advance.
-
I have a multidoctemplate app, call it MyApp. For the default doc-view-frame of MyAppDoc-MyAppView-CChildFrame, I override the frame ActivateFrame to show the frame maximized. I added another doc-view-frame set, NewDoc-NewView-NewFrame, NewFrame derived from CMDIChildWnd. I override NewFrame ActivateFrame to show it normal. When I create and show a NewDoc object, it displays correctly but now my MapAppView is no longer maximized but cascaded with the NewView object. Why would anything I do with NewView affect anything I had done with MyAppView? I want MyAppView to continue to be maximized but NewView to be normal since I may create a lot of NewView objects and I want them cascaded when they are first shown. Thanks in advance.
That's the default behavior/implementation. If one child frame is maximized, so are the others when activated. If you want one child frame maximized while the others are not, you will have to make it happen yourself. One suggestion would be to intercept the message when the user maximizes the window and then just resize it to the size needed and remove borders and other window decorations by modifying the window style. There are some things to take care of though, like when the main frame size changes, so should the 'maximized' child frame.
-
That's the default behavior/implementation. If one child frame is maximized, so are the others when activated. If you want one child frame maximized while the others are not, you will have to make it happen yourself. One suggestion would be to intercept the message when the user maximizes the window and then just resize it to the size needed and remove borders and other window decorations by modifying the window style. There are some things to take care of though, like when the main frame size changes, so should the 'maximized' child frame.