GetClipBox function

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(
  HDC    hdc,
  LPRECT lprect
);

Parameters

hdc

A handle to the device context.

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

   
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