GetWindowPlacement

  BOOL GetWindowPlacement(hwnd, lpwndpl)    
  HWND hwnd; /* handle of window */
  WINDOWPLACEMENT * lpwndpl; /* address of structure for position data */

The GetWindowPlacement function retrieves the show state and the normal (restored), minimized, and maximized positions of a window.

Parameters

hwnd

Identifies the window.

lpwndpl

Points to the WINDOWPLACEMENT structure that receives the show state and position information. The WINDOWPLACEMENT structure has the following form:

typedef struct tagWINDOWPLACEMENT { /* wndpl */

UINT length;

UINT flags;

UINT showCmd;

POINT ptMinPosition;

POINT ptMaxPosition;

RECT rcNormalPosition;

} WINDOWPLACEMENT;

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.

Comments

The flags member of the WINDOWPLACEMENT structure retrieved by this function is always zero. If the window identified by the hwnd parameter is maximized, the showCmd member of WINDOWPLACEMENT is SW_SHOWMAXIMIZED; if the window is minimized, it is SW_SHOWMINIMIZED; and it is SW_SHOWNORMAL otherwise.

See Also

SetWindowPlacement