Application.ProcessMessage作用

       运行一个非常耗时的循环,那么在这个循环结束前,程序可能不会响应任何事件,按钮没有反应,程序设置无法绘制窗体,看上去就如同死了一样,这有时不是很方便,例如于终止循环的机会都没有了,又不想使用多线程时,这时你就可以在循环中加上这么一句,每次程序运行到这句时,程序就会让系统响应一下消息,从而使你有机会按按钮,窗体有机会绘制。所起作用类似于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则然.
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
The wide range of applications available in GNU/Linux includes not only pure applications, but also tools and utilities for the GNU/Linux environment. GNU/Linux Application Programming takes a holistic approach to teaching developers the ins-and-outs of GNU/Linux programming using APIs, tools, communication, and scripting. Covering a variety of topics related to GNU/Linux application programming, the book is split into six parts: The GNU/Linux Operating System, GNU Tools, Application Development, Advanced Topics (including communication and synchronization and distributed computing), Debugging GNU/Linux Applications, and Scripting. <br/><br/>The book introduces programmers to the environment from the lowest layers (kernel, device drivers, modules) to the user layer (applications, libraries, tools), using an evolutionary approach that builds on knowledge to cover the more complex aspects of the operating system. Through a readable, code-based style developers will learn about the relevant topics of file handling, pipes and sockets, processes and POSIX threads, inter-process communication, and other development topics. After working through the text, they’ll have the knowledge base and skills to begin developing applications in the GNU/Linux environment. <br/><br/>Key Features:<br/><br/>Focuses on GNU/ Linux, not only the Linux APIs, but the GNU tools and libraries that make Linux programming possible <br/>Covers a variety of useful APIs for process management, shared memory, message queues, semaphores, POSIX, file handling, sockets, and more <br/>Provides detailed discussion of scripting and integration with the GNU/Linux environment with bash, including useful shell commands <br/>Introduces developers to GNU/Linux from the lowest layers (kernel, device drivers, modules) to the user layer (applications, libraries, tools) <br/>Explores the multiprocess and multithreaded programming APIs, including debugging applications with the GNU Debugger <br/>About the Author <br/><br/>M. Tim Jones is a successful software engineer and the author of TCP/IP Application Layer Protocols for Embedded Systems, BSD Sockets Programming from a Multi-Language Perspective, and AI Application Programming. He has also written for Dr. Dobbs Journal, Embedded Systems Programming, Circuit Cellar, and The Embedded Linux Journal.<br/>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值