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. set max size of program

set max size of program

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
6 Posts 5 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.
  • J Offline
    J Offline
    jafrazee
    wrote on last edited by
    #1

    is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app. thank you.

    P A M P 4 Replies Last reply
    0
    • J jafrazee

      is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app. thank you.

      P Offline
      P Offline
      Prem Kumar
      wrote on last edited by
      #2

      If you are looking at restricting even if the user wants to resize the appilcation to maximum size, you should not probably, in this case only dialogs can help. But if you want a work around for this probably indicating a thin border for your FrameWnd and explicitly disabling the System Menu SC_MAXIMIZE might help.

      1 Reply Last reply
      0
      • J jafrazee

        is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app. thank you.

        A Offline
        A Offline
        Alexandru Savescu
        wrote on last edited by
        #3

        Try to catch the WM_SIZE message and from there call SetWindowPos function to set a maximum size of your frame windows Best regards, Alexandru Savescu

        P 1 Reply Last reply
        0
        • A Alexandru Savescu

          Try to catch the WM_SIZE message and from there call SetWindowPos function to set a maximum size of your frame windows Best regards, Alexandru Savescu

          P Offline
          P Offline
          Prem Kumar
          wrote on last edited by
          #4

          The WM_SIZE is sent after the size has been changed, so you will get a flicker if you resize then.

          1 Reply Last reply
          0
          • J jafrazee

            is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app. thank you.

            M Offline
            M Offline
            Magnus Westin
            wrote on last edited by
            #5

            Check WM_GETMINMAXINFO in MSDN. Magnus

            1 Reply Last reply
            0
            • J jafrazee

              is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app. thank you.

              P Offline
              P Offline
              Paul M Watt
              wrote on last edited by
              #6

              You will want to use the WM_GETMINMAXINFO message. The OS will send this message to your window right before it is to be resized, and this is your windows chance to tell the OS the smallest size that the user can drag the window to and the largest that they can resize the window to. This message will also allow you to determine the maximized position dimensions. You can force a maximized window to only take up a small portion of the screen, and you can set the position of that reduced size window when the window is maximized. Look at FreeCell in the accesories folder for a demonstraction of this.


              Build a man a fire, and he will be warm for a day
              Light a man on fire, and he will be warm for the rest of his life!

              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