BOOL InvalidateRgn(hwnd, hRgn, bErase) | |||||
HWND hwnd; | /* handle of window with changed update region | */ | |||
HRGN hRgn; | /* handle of region to add | */ | |||
BOOL bErase; | /* erase-background flag | */ |
This function invalidates the client area within the given region by adding it to the current update region of the given window. The invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message occurs. The invalidated areas accumulate in the update region until the region is processed when the next WM_PAINT message occurs, or the region is validated by using the ValidateRect or ValidateRgn function.
The bErase parameter specifies whether the background within the update area is to be erased when the update region is processed. If bErase is nonzero, the background is erased when the BeginPaint function is called; if bErase is zero, the background remains unchanged. If bErase is nonzero for any part of the update region, the background in the entire region is erased, not just in the given part.
hwnd
Identifies the window whose update region is to be modified.
hRgn
Identifies the region to be added to the update region. The region is assumed to have client coordinates.
bErase
Specifies whether the background within the update region is to be erased.
This function does not return a value.
Windows sends a WM_PAINT message to a window whenever its update region is not empty and there are no other messages in the application queue for that window.
The given region must have been previously created by using one of the region functions (for more information, see Chapter 1, Window Manager Interface Functions).
BeginPaint, ValidateRect, ValidateRgn, InvalidateRect