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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. resizing dialog box to parent client area

resizing dialog box to parent client area

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.
  • B Offline
    B Offline
    b_girl
    wrote on last edited by
    #1

    I know I asked about this a few weeks ago, and someone was kind enough to supply me with some (still untested) code:

    CMyDialog::doMaximize()
    {
    CRect rect;
    GetParent()->GetClientRect(&rect);
    ClientToScreen(&rect);
    MoveWindow(&rect);
    }

    I was wondering what message had to be sent in order for this bit of code to get executed? The only ones I could think of using were WM_SIZE or WM_MOVE but I really don't think they're what I want. I tried handling the WM_SIZE, but it didn't do exactly what I'd like it to have done.

    T 1 Reply Last reply
    0
    • B b_girl

      I know I asked about this a few weeks ago, and someone was kind enough to supply me with some (still untested) code:

      CMyDialog::doMaximize()
      {
      CRect rect;
      GetParent()->GetClientRect(&rect);
      ClientToScreen(&rect);
      MoveWindow(&rect);
      }

      I was wondering what message had to be sent in order for this bit of code to get executed? The only ones I could think of using were WM_SIZE or WM_MOVE but I really don't think they're what I want. I tried handling the WM_SIZE, but it didn't do exactly what I'd like it to have done.

      T Offline
      T Offline
      Terry ONolley
      wrote on last edited by
      #2

      Have you tried putting it in OnInitDialog?


      Have you answered an MTQ? Check out the stats!


      B 1 Reply Last reply
      0
      • T Terry ONolley

        Have you tried putting it in OnInitDialog?


        Have you answered an MTQ? Check out the stats!


        B Offline
        B Offline
        b_girl
        wrote on last edited by
        #3

        By putting it in OnInitDialog, wouldn't that start the dialog out maximized? I want it to maximize like that only when the user clicks on the maximize button up in the top corner of the dialog, otherwise I want it to remain the size it was when it opened initially (and also be able to be minimized)

        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