CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

关于WM_PAINT和InvalidateRect

楼主toyee(toyee)2001-06-24 23:39:00 在 VC/MFC / 基础类 提问

在几乎所有的vc书籍中都这样描述InvalidateRect():“……发出WM_PAINT信息,引发对矩形区域的重绘……”  
  可是在MSDN中关于这个函数却有如下的描述:  
  The   invalidated   rectangle,   along   with   all   other   areas   in   the   update   region,   is   marked   for   painting   when   the   next   WM_PAINT   message   is   sent.    
  仔细读这段话,意思是这个函数仅仅作一个更新标志,而并非发送WM_PAINT信息。  
   
  到底InvaldateRect是否发送该信息?谢谢各位赐教! 问题点数:26、回复次数:3Top

1 楼xxxbird(*说你行,你就行,不行也行*)回复于 2001-06-25 00:10:00 得分 26

From   MSDN:  
  ------  
  The   invalidated   areas   accumulate   in   the   update   region   until   the   region   is   processed   when   the   next   WM_PAINT   message   occurs   or   until   the   region   is   validated   by   using   the   ValidateRect   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.    
  ------  
   
  实际上InvalidateRect是不发送该消息的.   通常在InvalidateRect后要调用UpdateWindow.   UpdateWindow   才发送WM_PAINT   消息。Top

2 楼toyee(toyee)回复于 2001-06-26 00:05:06 得分 0

那么调用UpdateWindow是系统自动进行的吗?Top

3 楼xxxbird(*说你行,你就行,不行也行*)回复于 2001-06-26 06:51:07 得分 0

UpdateWindow需要自己调用。Top

相关问题

  • WM_PAINT消息
  • 从CDialog派生的类处理WM_PAINT和WM_NCPAINT的问题
  • 每次 case WM_PAINT:
  • 为什么我在windowpro中的wm_paint中使用InValidateRect(hwnd,NULL,FALSE)使窗口无效,但系统出错说hwnd,NULL,FALSE不被声明,请问这是怎
  • 关于WM_PAINT消息
  • 关于WM_PAINT的疑问
  • 关于WM_PAINT的疑问
  • WM_PAINT的奇怪现象
  • 如何发送WM_PAINT消息? GetParent()->SendMessage(WM_PAINT); ??????
  • 关于几种消息的区别?WM_QUIT WM_DESTROY WM_DRAW WM_PAINT

关键词

  • 信息
  • invalidaterect
  • paint
  • wm
  • updatewindow
  • region
  • 发送
  • update
  • messages

得分解答快速导航

  • 帖主:toyee
  • xxxbird

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo