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

博客介绍了两个函数。InvalidateRect函数将矩形添加到指定窗口的更新区域,更新区域代表需重绘的窗口客户区部分;InvalidateRgn函数通过将指定区域添加到窗口当前更新区域来使其无效,下次WM_PAINT消息出现时标记为需绘制。
1665

被折叠的 条评论
为什么被折叠?



