This documentation is archived and is not being maintained.


Controls the accumulation of bounding-rectangle information for the specified device context.

UINT SetBoundsRect(
   LPCRECT lpRectBounds,
   UINT flags 



Points to a RECT structure or CRect object that is used to set the bounding rectangle. Rectangle dimensions are given in logical coordinates. This parameter can be NULL.


Specifies how the new rectangle will be combined with the accumulated rectangle. This parameter can be a combination of the following values:

  • DCB_ACCUMULATE   Add the rectangle specified by lpRectBounds to the bounding rectangle (using a rectangle-union operation).

  • DCB_DISABLE   Turn off bounds accumulation.

  • DCB_ENABLE   Turn on bounds accumulation. (The default setting for bounds accumulation is disabled.)

The current state of the bounding rectangle, if the function is successful. Like flags, the return value can be a combination of DCB_ values:

  • DCB_ACCUMULATE   The bounding rectangle is not empty. This value will always be set.

  • DCB_DISABLE   Bounds accumulation is off.

  • DCB_ENABLE   Bounds accumulation is on.

Windows can maintain a bounding rectangle for all drawing operations. This rectangle can be queried and reset by the application. The drawing bounds are useful for invalidating bitmap caches.