UpdateWindow和Invalidate
来源:互联网 发布:网络协议组成部分为() 编辑:程序博客网 时间:2024/06/04 23:27
The UpdateWindow function updates the client area of the specified window by sending aWM_PAINT message to the window if the window's update region is not empty. The function sends aWM_PAINT message directly to the window procedure of the specified window, bypassing the application queue. If the update region is empty, no message is sent.
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.
The invalidated areas accumulate in the update region until the region is processed when the nextWM_PAINT message occurs or until the region is validated by using theValidateRect or ValidateRgn function.
The system 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.
If the bErase parameter is TRUE for any part of the update region, the background is erased in the entire region, not just in the specified part.
翻译成中文大概的解释如下:
UpdateWindow:如果有无效区,则马上发送 WM_PAINT 消息到窗口处理过程,不进消息队列进行排队等待,立即刷新窗口,否则,什么都不做。
InvalidateRect:设置无效区,如果为NULL参数,则设置整个窗口为无效区。当应用程序的那个窗口的消息队列为空时,则发送 WM_PAINT 消息(即使更新区域为空).在sending a WM_PAINT message的所有InvalidateRect的更新区域会累加。
所以一般的用法是
1:设置无效区
InvalidateRect
2:立即刷新
UpdateWindow();
如果不调用 InvalidateRect就调用 UpdateWindow,那么UpdateWindow什么都不做,因为没有无效区域。
如果调用 InvalidateRect 后不调用UpdateWindow,则系统会自动在窗口消息队列为空的时候,系统自动发送一WM_PAINT消息,而不是立即刷新。
- Invalidate、InvalidateRect和UpdateWindow
- Invalidate 和 UpdateWindow 小记
- Invalidate()和UpdateWindow( )区别
- 关于Invalidate和UpdateWindow
- UpdateWindow和Invalidate
- Invalidate 和 UpdateWindow
- Invalidate和UpdateWindow的区别
- 对Invalidate()和updateWindow 理解
- Invalidate和UpdateWindow的区别
- UpdateData、Invalidate、InvalidateRect和UpdateWindow
- 关于Invalidate、InvalidateRect和UpdateWindow
- UpdateWindow和Invalidate的区别
- UpdateData、Invalidate、InvalidateRect和UpdateWindow
- 关于Invalidate、InvalidateRect和UpdateWindow
- 关于Invalidate、InvalidateRect和UpdateWindow
- 关于Invalidate、InvalidateRect和UpdateWindow
- Invalidate和UpdateWindow的区别
- UpdateData、Invalidate、InvalidateRect和UpdateWindow
- 怎样把网站变为灰色
- php多进程
- 字典树 (解析加模版)
- 自定义listview的显示(重写Adapter)
- krpano Flash Panorama Viewer应用及介绍
- UpdateWindow和Invalidate
- Memory Analysis for Android Applications
- ActionScript最新3D引擎项目(转载)
- ORA-15001
- 使用Javassist对.class文件进行修改(AOP面向切面编程)
- 正则表达式30分钟入门
- android从网络中获取一张图片
- 降级论
- hdu1227 Fast Food