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. How to make and MDI child window resizeable for a concrete size

How to make and MDI child window resizeable for a concrete size

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialcsshelp
5 Posts 3 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.
  • M Offline
    M Offline
    Mario M 0
    wrote on last edited by
    #1

    I want a MDI child window to be resizeable not less than 200 not bigger than 500 pix for example, and only height. When you size the window less than that 200 pix the application should make the window 200 height, when you size to 300 pix won´t do anything, and when it will be bigger than 500 size to 500. I think it should be done on OnSize function but i dont know how. Other option is let sizing window in this interval 200-500 and when reach it 200 or 500 stop sizing. help would be appreciate, thanks.

    R K 2 Replies Last reply
    0
    • M Mario M 0

      I want a MDI child window to be resizeable not less than 200 not bigger than 500 pix for example, and only height. When you size the window less than that 200 pix the application should make the window 200 height, when you size to 300 pix won´t do anything, and when it will be bigger than 500 size to 500. I think it should be done on OnSize function but i dont know how. Other option is let sizing window in this interval 200-500 and when reach it 200 or 500 stop sizing. help would be appreciate, thanks.

      R Offline
      R Offline
      Rene De La Garza
      wrote on last edited by
      #2

      you better handle WM_GETMINMAXINFO message.

      1 Reply Last reply
      0
      • M Mario M 0

        I want a MDI child window to be resizeable not less than 200 not bigger than 500 pix for example, and only height. When you size the window less than that 200 pix the application should make the window 200 height, when you size to 300 pix won´t do anything, and when it will be bigger than 500 size to 500. I think it should be done on OnSize function but i dont know how. Other option is let sizing window in this interval 200-500 and when reach it 200 or 500 stop sizing. help would be appreciate, thanks.

        K Offline
        K Offline
        klphua
        wrote on last edited by
        #3

        And here's some example... void ::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // TODO: Add your message handler code here and/or call default if (m_bInit) // Make sure the view is initiated { lpMMI->ptMinTrackSize.x = ; lpMMI->ptMinTrackSize.y = ; } ::OnGetMinMaxInfo(lpMMI); }

        R 1 Reply Last reply
        0
        • K klphua

          And here's some example... void ::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // TODO: Add your message handler code here and/or call default if (m_bInit) // Make sure the view is initiated { lpMMI->ptMinTrackSize.x = ; lpMMI->ptMinTrackSize.y = ; } ::OnGetMinMaxInfo(lpMMI); }

          R Offline
          R Offline
          Rene De La Garza
          wrote on last edited by
          #4

          If you handle the message you should not call BaseClass::OnGetMinMaxInfo(lpMMI) right?

          M 1 Reply Last reply
          0
          • R Rene De La Garza

            If you handle the message you should not call BaseClass::OnGetMinMaxInfo(lpMMI) right?

            M Offline
            M Offline
            Mario M 0
            wrote on last edited by
            #5

            Thanks, I handle WM_GETMINMAXINFO in CChildFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI){ // TODO: ..... lpMMI->ptMinTrackSize.x = 200; lpMMI->ptMaxTrackSize.x = 500; } it works but now i have a problem :confused:, I size the window to the min pixel size I choose, all ok, but then I try to make the window bigger traking it the traking border of the window not appear. why this problem? I use XP.

            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