1、InvalidateRect
The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.
BOOL InvalidateRect(
HWND hWnd, // handle of window with changed update region
CONST RECT *lpRect,
// address of rectangle coordinates
BOOL bErase // erase-background flag
);
2、InvalidateRgn
The InvalidateRgn function invalidates the client area within the specified region by adding it to the current update region of a window. The invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message occurs.
BOOL InvalidateRgn(
HWND hWnd, // handle of window with changed update region
HRGN hRgn, // handle of region to add
BOOL bErase // erase-background flag
);