Application.ProcessMessage作用
2012-07-11 13:05
447 查看
运行一个非常耗时的循环,那么在这个循环结束前,程序可能不会响应任何事件,按钮没有反应,程序设置无法绘制窗体,看上去就如同死了一样,这有时不是很方便,例如于终止循环的机会都没有了,又不想使用多线程时,这时你就可以在循环中加上这么一句,每次程序运行到这句时,程序就会让系统响应一下消息,从而使你有机会按按钮,窗体有机会绘制。所起作用类似于VB中DoEvent方法.
Call ProcessMessages to permit the application to process messages that are currently in the message queue. ProcessMessages cycles the Windows message
loop until it is empty, and then returns control to the application.
Note: Neglecting message processing affects only the application calling ProcessMessages, not other applications. In lengthy operations, calling ProcessMessages
periodically allows the application to respond to paint and other messages.
Note: ProcessMessages does not allow the application to go idle, whereas HandleMessage does.
调用ProcessMessages来使应用程序处于消息队列能够进行消息处理,ProcessMessages将Windows消息进行循环轮转,直至消息为空,然后将控制返回给应用程序。
注示:仅在应用程序调用ProcessMessages时勿略消息进程效果,而并非在其他应用程序中。在冗长的操作中,调用ProcessMessages周期性使得应用程序对画笔或其他信息产生回应。
注示:ProcessMessages不充许应该程序空闲,而HandleMessage则然.
Call ProcessMessages to permit the application to process messages that are currently in the message queue. ProcessMessages cycles the Windows message
loop until it is empty, and then returns control to the application.
Note: Neglecting message processing affects only the application calling ProcessMessages, not other applications. In lengthy operations, calling ProcessMessages
periodically allows the application to respond to paint and other messages.
Note: ProcessMessages does not allow the application to go idle, whereas HandleMessage does.
调用ProcessMessages来使应用程序处于消息队列能够进行消息处理,ProcessMessages将Windows消息进行循环轮转,直至消息为空,然后将控制返回给应用程序。
注示:仅在应用程序调用ProcessMessages时勿略消息进程效果,而并非在其他应用程序中。在冗长的操作中,调用ProcessMessages周期性使得应用程序对画笔或其他信息产生回应。
注示:ProcessMessages不充许应该程序空闲,而HandleMessage则然.
相关文章推荐
- Application.ProcessMessages的作用
- VC里的Application.ProcessMessage()功能类似的函数
- 对request,session,application作用域形象理解
- application、session、request和page的作用范围
- 文件作用解析之:application_top.php
- Application.ProcessMessages
- Android Application.java以及其作用
- PreTranslateMessage作用和使用方法
- AndroidManifest.xml中定义的application name的作用
- ViewState、Cookie、Session、Application的作用与区别
- PreTranslateMessage作用和用法
- Managing Your ASP.NET Application[5]->Configuring the Process Model
- ProcessMessageFilter()方法实现对话框的键盘响应
- Android Application的作用
- 【SpringMVC之配置文件(一)】spring 里面的ApplicationContext.xml 和 xxx-servlet.xml分别的作用是什么?
- media-dispatcher启动时报ImportError: No module named application.process错误的解决
- RibbonApplicationMenu - Label 设置不启作用
- 【挖坑待填写】openflow1.3各种类型message的作用
- 对request,session,application作用域形象理解
- Application.EnableVisualStyles()的作用