AdjustWindowRectEx

  BOOL AdjustWindowRectEx(lprc, fdwStyle, fMenu, fdwExStyle)    
  LPRECT lprc; /* address of client-rectangle structure */
  DWORD fdwStyle; /* window styles */
  BOOL fMenu; /* menu-present flag */
  DWORD fdwExStyle; /* extended style */

The AdjustWindowRectEx function computes the required size of the rectangle of a window with extended style based on the desired client-rectangle size. The window rectangle can then be passed to the CreateWindowEx function to create a window whose client area is the desired size.

Parameters

lprc

Points to a RECT structure that contains the coordinates of the client rectangle. The RECT structure has the following form:

typedef struct tagRECT { /* rc */

LONG left;

LONG top;

LONG right;

LONG bottom;

} RECT;

fdwStyle

Specifies the window styles of the window whose client rectangle is to be converted.

fMenu

Specifies whether the window has a menu.

fdwExStyle

Specifies the extended style of the window being created.

Return Value

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

Comments

A client rectangle is the smallest rectangle that completely encloses a client area. A window rectangle is the smallest rectangle that completely encloses the window.

AdjustWindowRectEx does not take captions and borders into account when computing the size of the the client area. For window styles that include captions and borders, applications must add the caption and border sizes after calling AdjustWindowRectEx. This function also does not take the extra rows into account when a menu bar wraps to two or more rows.

See Also

CreateWindowEx, AdjustWindowRect