AdjustWindowRectEx

Version 3.0

Syntax

void AdjustWindowRectEx(lpRect,dwStyle,bMenu,dwExStyle)

This 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.

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. The dimensions of the resulting window rectangle depends on the window styles and on whether the window has a menu.

Parameter Type/Description  

lpRect LPRECT Points to a RECT data structure that contains the coordinates of the client rectangle.  
dwStyle DWORD Specifies the window styles of the window whose client rectangle is to be converted.  
bMenu BOOL Specifies whether the window has a menu.  
dwExStyle DWORD Specifies the extended style of the window being created.  

Return Value

None.

Comments

This function assumes a single menu row. If the menu bar wraps to two or more rows, the coordinates are incorrect.