GetUpdateRgn

  int GetUpdateRgn(hwnd, hRgn, bErase)    
  HWND hwnd; /* handle of window */
  HRGN hRgn; /* handle of region */
  BOOL bErase; /* erase flag */

This function copies a window's update region into a region identified by the hRgn parameter. The coordinates of this region are relative to the upper-left corner of the window (client coordinates).

Parameters

hwnd

Identifies the window that contains the region to be updated.

hRgn

Identifies the update region.

bErase

Specifies whether or not the window background should be erased and nonclient areas of child windows should be drawn. If it is zero, no drawing is done.

Return Value

The return value indicates the type of resulting region. It can be any one of the following values:

Value Meaning

COMPLEXREGION The region has overlapping borders.
ERROR No region was created.
NULLREGION The region is empty.
SIMPLEREGION The region has no overlapping borders.

Comments

BeginPaint automatically validates the update region, so any call to GetUpdateRgn made immediately after the BeginPaint call retrieves an empty update region.

See Also

BeginPaint, GetUpdateRect