GetClipBox function (wingdi.h)

The GetClipBox function retrieves the dimensions of the tightest bounding rectangle that can be drawn around the current visible area on the device. The visible area is defined by the current clipping region or clip path, as well as any overlapping windows.

Syntax

int GetClipBox(
  [in]  HDC    hdc,
  [out] LPRECT lprect
);

Parameters

[in] hdc

A handle to the device context.

[out] lprect

A pointer to a RECT structure that is to receive the rectangle dimensions, in logical units.

Return value

If the function succeeds, the return value specifies the clipping box's complexity and can be one of the following values.

Return code Description
NULLREGION
Region is empty.
SIMPLEREGION
Region is a single rectangle.
COMPLEXREGION
Region is more than one rectangle.
ERROR
An error occurred.
 

GetClipBox returns logical coordinates based on the given device context.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Clipping Functions

Clipping Overview

RECT