AdjustWindowRect

Syntax

void AdjustWindowRect(lpRect,dwStyle,bMenu)

This function computes the required size of the window rectangle based on the desired client-rectangle size. The window rectangle can then be passed to the CreateWindow 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 depend 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.  

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.