GetUpdateRgn

Syntax

int GetUpdateRgn(hWnd,hRgn,fErase)

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).

Parameter Type/Description  

hWnd HWND Identifies the window that contains the region to be updated.  
hRgn HRGN Identifies the update region.  
fErase BOOL 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 specifies a short-integer flag that 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.