void InvalidateRgn(hWnd,hRgn,bErase)
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.
Parameter | Type/Description |
hWnd | HWND Identifies the window whose update region is to be modified. | |
hRgn | HRGN Identifies the region to be added to the update region. The region is assumed to have client coordinates. | |
bErase | BOOL Specifies whether the background within the update region is to be erased. |
None.
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”).