Export (0) Print
Expand All

GetWindowRgnBox function

The GetWindowRgnBox function retrieves the dimensions of the tightest bounding rectangle for the window region of a window.

Syntax


int GetWindowRgnBox(
  _In_   HWND hWnd,
  _Out_  LPRECT lprc
);

Parameters

hWnd [in]

Handle to the window.

lprc [out]

Pointer to a RECT structure that receives the rectangle dimensions, in device units relative to the upper-left corner of the window.

Return value

The return value specifies the type of the region that the function obtains. It can be one of the following values.

ValueMeaning
COMPLEXREGIONThe region is more than one rectangle.
ERRORThe specified window does not have a region, or an error occurred while attempting to return the region.
NULLREGIONThe region is empty.
SIMPLEREGIONThe region is a single rectangle.

 

Remarks

The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region. The coordinates of a window's window region are relative to the upper-left corner of the window, not the client area of the window.

To set the window region of a window, call the SetWindowRgn function.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Painting and Drawing Overview
Painting and Drawing Functions
SetWindowRgn
GetWindowRgn
GetClipBox
RECT

 

 

Community Additions

ADD
Show:
© 2014 Microsoft