WINDOWPLACEMENT structure (winuser.h)
Contains information about the placement of a window on the screen.
Syntax
typedef struct tagWINDOWPLACEMENT {
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
RECT rcDevice;
} WINDOWPLACEMENT;
Members
length
Type: UINT
The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT)
.
GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
flags
Type: UINT
The flags that control the position of the minimized window and the method by which the window is restored. This member can be one or more of the following values.
showCmd
Type: UINT
The current show state of the window. It can be any of the values that can be specified in the nCmdShow parameter for the ShowWindow function.
ptMinPosition
Type: POINT
The coordinates of the window's upper-left corner when the window is minimized.
ptMaxPosition
Type: POINT
The coordinates of the window's upper-left corner when the window is maximized.
rcNormalPosition
Type: RECT
The window's coordinates when the window is in the restored position.
rcDevice
Remarks
If the window is a top-level window that does not have the WS_EX_TOOLWINDOW window style, then the coordinates represented by the following members are in workspace coordinates: ptMinPosition, ptMaxPosition, and rcNormalPosition. Otherwise, these members are in screen coordinates.
Workspace coordinates differ from screen coordinates in that they take the locations and sizes of application toolbars (including the taskbar) into account. Workspace coordinate (0,0) is the upper-left corner of the workspace area, the area of the screen not being used by application toolbars.
The coordinates used in a WINDOWPLACEMENT structure should be used only by the GetWindowPlacement and SetWindowPlacement functions. Passing workspace coordinates to functions which expect screen coordinates (such as SetWindowPos) will result in the window appearing in the wrong location. For example, if the taskbar is at the top of the screen, saving window coordinates using GetWindowPlacement and restoring them using SetWindowPos causes the window to appear to "creep" up the screen.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Header | winuser.h (include Windows.h) |
See also
Conceptual
Reference