SetMinWindowSize window[,width][,height]
Parameters
|
window - window to limit width (optional) - minimum window width in logical pixels; -1 removes the limit (default) height (optional) - minimum window height in logical pixels; -1 removes the limit (default) |
Description
|
Stops the user shrinking a resizable window below a minimum size. Requires Extended language mode. Every layout has a size below which it stops making sense - panes collapse, buttons overlap. Pick the smallest arrangement that still works and pin it: SetMinWindowSize window,600,420 The limit applies when the user drags the window frame. The sizes are for the whole window, frame included, in the same 96-DPI logical pixels the rest of the GUI uses, and each axis can be limited independently - the default -1 leaves an axis unconstrained. Calling again replaces the previous limits. This pairs naturally with SetGadgetLayout: layout rules keep gadgets arranged as the window grows, and the minimum size guarantees they never get crushed. See it working in the window and button sample. See also: CreateWindow, SetGadgetLayout, ClientWidth, ClientHeight, MaximizeWindow. |
Index