UINT GetBoundsRect(hdc, lprcBounds, flags) | |||||
HDC hdc; | /* handle of a device context | */ | |||
LPRECT lprcBounds; | /* points to buffer for bounds rectangle | */ | |||
UINT flags; | /* specifies information to return | */ |
The GetBoundsRect function returns the current accumulated bounding rectangle for the specified device context.
Windows maintains two accumulated bounding rectangles — one for the application and one reserved for use by Windows. An application can query and set its own rectangle, but can only query the Windows rectangle.
hdc
Identifies the device context.
lprcBounds
Points to a buffer that will receive the current bounding rectangle. The application's rectangle is returned in logical coordinates and the Windows rectangle is returned in screen coordinates.
flags
Specifies the type of information to return. This parameter may be some combination of the following values:
Value | Meaning |
DCB_RESET | Force the bounding rectangle to be cleared after it is returned. |
DCB_WINDOWMGR | Query the Windows bounding rectangle instead of the application's. |
The return value specifies the current bounds rectangle state. It may be some combination of the following values:
Value | Meaning |
DCB_ACCUMULATE | Bounds rectangle accumulation is occurring. |
DCB_RESET | The bounds rectangle is empty. |
DCB_SET | The bounds rectangle is not empty. |
DCB_ENABLE | Bounds accumulation is on. |
DCB_DISABLE | Bounds accumulation is off. |
To be sure that the bounds rectangle is empty, you must check both the DCB_RESET bit and the DCB_ACCUMULATE flag in the return value. If the DCB_RESET flag is on and the DCB_ACCUMULATE flag is OFF, the bounds rectangle is empty.
SetBoundsRect