set max size of program
-
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.
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.
-
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.
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
-
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
The WM_SIZE is sent after the size has been changed, so you will get a flicker if you resize then.
-
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.
Check WM_GETMINMAXINFO in MSDN. Magnus
-
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.
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!