1 out of 2 rated this helpful - Rate this topic

WM_GETMINMAXINFO message

Applies to: desktop apps only

Sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.

A window receives this message through its WindowProc function.

#define WM_GETMINMAXINFO                0x0024

Parameters

wParam

This parameter is not used.

lParam

A pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.

Return value

Type: LRESULT

If an application processes this message, it should return zero.

Remarks

The maximum tracking size is the largest window size that can be produced by using the borders to size the window. The minimum tracking size is the smallest window size that can be produced by using the borders to size the window.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
MoveWindow
SetWindowPos
MINMAXINFO
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
WM_GETMINMAXINFO not working when max position has negative values

Hi,

Windows 7 ignores the ptMaxPosition I specifies when either x or y are negative values or both are 0. It works when both are positive. Is there a way to fix? am I doing something wrong? Here is a snippet:

--------

case WM_NCCALCSIZE:

return true ;

case WM_GETMINMAXINFO:

                     MINMAXINFO * minMaxInfo = ( MINMAXINFO *)( message -> lParam );

                     POINTpoint;

                      point.x=-10;

                     point.y=-10;

                     minMaxInfo->ptMaxPosition=point;

                     *result=0;

                      returnfalse;

--------------------

The position I set is ignored.

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.
Value
WM_GETMINMAXINFO = &H24