This topic has not yet been rated - Rate this topic

MINMAXINFO structure

Applies to: desktop apps only

Contains information about a window's maximized size and position and its minimum and maximum tracking size.

Syntax

typedef struct tagMINMAXINFO {
  POINT ptReserved;
  POINT ptMaxSize;
  POINT ptMaxPosition;
  POINT ptMinTrackSize;
  POINT ptMaxTrackSize;
} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;

Members

ptReserved

Type: POINT

Reserved; do not use.

ptMaxSize

Type: POINT

The maximized width (x member) and the maximized height (y member) of the window. For top-level windows, this value is based on the width of the primary monitor.

ptMaxPosition

Type: POINT

The position of the left side of the maximized window (x member) and the position of the top of the maximized window (y member). For top-level windows, this value is based on the position of the primary monitor.

ptMinTrackSize

Type: POINT

The minimum tracking width (x member) and the minimum tracking height (y member) of the window. This value can be obtained programmatically from the system metrics SM_CXMINTRACK and SM_CYMINTRACK (see the GetSystemMetrics function).

ptMaxTrackSize

Type: POINT

The maximum tracking width (x member) and the maximum tracking height (y member) of the window. This value is based on the size of the virtual screen and can be obtained programmatically from the system metrics SM_CXMAXTRACK and SM_CYMAXTRACK (see the GetSystemMetrics function).

Remarks

For systems with multiple monitors, the ptMaxSize and ptMaxPosition members describe the maximized size and position of the window on the primary monitor, even if the window ultimately maximizes onto a secondary monitor. In that case, the window manager adjusts these values to compensate for differences between the primary monitor and the monitor that displays the window. Thus, if the user leaves ptMaxSize untouched, a window on a monitor larger than the primary monitor maximizes to the size of the larger monitor.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
POINT
WM_GETMINMAXINFO
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Values are for total size of window
It should be noted, that the values specified in the MINMAXINFO structure are the client plus non-client (including the caption and borders) size of the window. Most Windows programmers know this, but it isn't really noted here.
Multimonitor maximize problem
There is problem with the ptMaxPosition. Imagine I want to maximize a window to the multi-monitor complete desktop... To maximize always to the primary ( or larger ) monitor is a problem... I think will be much better to let the programmer or the user to specify how and where to maximixe the window.
Always set ptMinTrackSize to valid value
Make sure you don't set ptMinTrackSize to extremely large numbers. I did this by mistake (through uninitialized variable on stack). This can break desktop composition for entire session and you will need to log off and on again. I have experienced this in Windows Vista and haven't tried on other Windows versions.