UpdateWindow和Invalidate的区别
来源:互联网 发布:剑灵剑士捏脸数据大全 编辑:程序博客网 时间:2024/05/16 12:12
UpdateWindow和Invalidate的区别
MSDN的解释
UpdateWindow
The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window 's update region is not empty. The function sends a WM_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.
InvalidateRect
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.
翻译成中文大概的解释如下:
UpdateWindow:如果有无效区,则马上sending a WM_PAINT message到窗口处理过程,不进消息队列进行排队等待,立即刷新窗口,否则,什么都不做。
InvalidateRect:设置无效区,如果为NULL参数,则设置整个窗口为无效区。当应用程序的那个窗口的消息队列为空时,则sending a WM_PAINT message(即使更新区域为空).在sending a WM_PAINT message的所有InvalidateRect的更新区域会累加。
所以一般的用法是
1:设置无效区
InvalidateRect
2:立即刷新
UpdateWindow();
如果不调用 InvalidateRect就调用 UpdateWindow,那么UpdateWindow什么都不做。
如果调用 InvalidateRect 后不调用UpdateWindow,则系统会自动在窗口消息队列为空的时候,系统自动发送一WM_PAINT消息。
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- UpdateWindow和Invalidate的区别
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- invalidate和updatewindow的区别
- Invalidate和UpdateWindow的区别
- Invalidate和UpdateWindow的区别
- Invalidate()和UpdateWindow()的区别
- Invalidate和UpdateWindow的区别
- Invalidate()和UpdateWindow( )区别
- Invalidate() 、RedrawWindow()和UpdateWindow()的区别
- Invalidate与UpdateWindow的区别
- Invalidate与UpdateWindow的区别
- Invalidate、UpdateWindow、RedrawWindow的区别
- cannot convert from 'const char [n]' to 'LPCWSTR'2009
- 显示分辨率
- ROLLUP和CUBE语句
- 亦舒的话,我的感触...
- WinCE下重启系统的方法
- UpdateWindow和Invalidate的区别
- asp.net页面事件重写问题
- 在Jsp/Servlet中页面重新定向总汇
- httpclient开发
- 开发人员一定要加入收藏夹的网站收藏
- SaaS 软件服务化
- 查找两个字符串的最长公共子串的Javascript函数
- inezha(哪吒网)这个思路很不错
- 开始鄙视我自己