The InvalidateRgn function invalidates the customer region of the specified rectangle by adding an area to the update area of a window; this invalid region and other regions in all update regions will be marked for plotting when the next WM_PAINT message occurs.
BOOL InvalidateRgn (
HWND hWnd, // window handle
HRGN hRgn, // region handle
BOOL bErase // erased status
);
Parameters:
HWnd: [input] HANDLE of the updated region modified window
HRgn: [input] HANDLE of the region added to the update region. This region is assumed to have a client zone coordinate. If this parameter is NULL, the entire customer zone is added to the update region.
BErase: [input] indicates whether to erase the background in the update area when the update area is processed. If this parameter is TRUE, the background will be erased when the BeginPaint function is called. If the parameter is FALSE, the background will not change.
Return Value: The returned value is always not 0.
Note:
Invalid regions are accumulated until the next WM_PAINT message is processed or the region becomes valid through ValidateRect or ValidateRgn.
The system sends a WM_PAINT message to a window. No matter whether the update area of the window is empty, there are other messages in the window application queue.
The specified region must have been created using a region function.
If the bErase parameter of any part of the updated area is TRUE, the background of the entire area is erased, rather than the specified part.
Required platform:
Windows nt/2000/XP: including after WINNT3.1
WIN95/98/ME: including Versions later than 95
Header file: declared in winuser. h, including windows. h
Library File: User32.lib