windows API一日一学(2)---InvalidateRect函数
来源:互联网 发布:康佳lc24fs66dc数据 编辑:程序博客网 时间:2024/05/29 19:14
InvalidateRect函数
该函数添加一个区域到指定窗口的更新区域。更新区域代表窗口客户端的一部分,这部分必须进行重新绘制。
BOOL InvalidateRect(
HWND hWnd,
const RECT *lpRect,
BOOL bErase
);
参数:
hWnd
指向需要重新绘制的窗口句柄。如果该参数为空,系统将更新和重新绘制所有的窗口,然后在该函数返回之前发送WM_ERASEBKGND给窗口过程.
lpRect
一个指向RECT的结构体,该结构包含了要添加到更新区域的长方形区域的坐标。如果该参数为NULL,整个客户端区域将会被添加到更新区域。
bErase
该参数为布尔型。指定了当更新区域重新绘制时,更新区域的背景是否被擦除掉。
返回值
函数执行成功时返回非零, 失败时返回零。要获取更多的关于错误的信息,可以调用GetLastError();
注意事项
参数hWnd不能为NULL
无效区域不会马上更新,相反会在更新区域“累积”,直到当下一个WM_PAINT消息发生时或者该区域已经被ValidateRect函数更新过。
当应用程序队列中没有其他的消息时,并且更新区域不为空时,系统将向窗口发送WM_PAINTA消息 。如果bErase为TRUE,则整个背景将会被擦除,而不是给定的区域。
- windows API一日一学(2)---InvalidateRect函数
- Windows API一日一练(69)GetTickCount函数 计时函数
- Windows API一日一练(4)MessageBox函数
- Windows API一日一练(5)RegisterClass和RegisterClassEx函数
- Windows API一日一练(6)CreateWindow函数
- Windows API一日一练(7)ShowWindow函数
- Windows API一日一练(8)UpdateWindow函数
- Windows API一日一练(9)WindowProc和DefWindowProc函数
- Windows API一日一练(4)MessageBox函数
- Windows API一日一练(10)LoadAccelerators函数
- Windows API一日一练(11)GetMessage函数
- Windows API一日一练(12)TranslateAccelerator函数
- Windows API一日一练(13)TranslateMessage函数
- Windows API一日一练(14)DispatchMessage函数
- Windows API一日一练(15)PostQuitMessage函数
- Windows API一日一练(16)BeginPaint和EndPaint函数
- Windows API一日一练(17)DialogBox和DialogBoxParam函数
- Windows API一日一练(17)DialogBox和DialogBoxParam函数
- 增加 magento top_menu菜单
- RTEMS文件系统(3):挂载和卸载文件系统
- java线程基础
- 便秘小配方:蜂蜜+陈醋
- 内核映像的形成——制作bzImage
- windows API一日一学(2)---InvalidateRect函数
- 关于Invalidate、InvalidateRect和UpdateWindow
- Hibernate 连 Access
- spandsp与传真开发
- 喜欢这里
- 理解本体
- DLL与Exe利用共享内存通信模拟
- 优化你的PowerBuilder程序
- How does Xen's Guest Domain wake up..?