Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CMDIChildWnd changing size unexpectedly

CMDIChildWnd changing size unexpectedly

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    genush
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • G genush

      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.

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      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.

      home

      G 1 Reply Last reply
      0
      • N Niklas L

        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.

        home

        G Offline
        G Offline
        genush
        wrote on last edited by
        #3

        Thank you for the response. I tried that by overriding OnSize in both the child frame I want to keep maximized and the others I want to cascade. But the ones I want to cascade still come up maximized. I'll keep fiddling around with it.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups