GetWindowRgnBox function

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

Syntax

int GetWindowRgnBox(
  HWND   hWnd,
  LPRECT lprc
);

Parameters

hWnd

Handle to the window.

lprc

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.

Value Meaning
COMPLEXREGION The region is more than one rectangle.
ERROR The specified window does not have a region, or an error occurred while attempting to return the region.
NULLREGION The region is empty.
SIMPLEREGION The 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]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

GetClipBox

GetWindowRgn

Painting and Drawing Functions

Painting and Drawing Overview

RECT

SetWindowRgn