消息队列 [英] Message Queue

查看:97
本文介绍了消息队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被很多文章弄糊涂了.
谁能告诉我在基于对话框的应用程序中有多少个消息队列.
每个窗口是否有单独的消息队列,或者每个线程都有自己的消息队列.
:confused:

I am confused by reading many articles.
Can any one tell me how many message queues are there in dialog based application.
Are there separate message queues for each window or each thread has its own message queue.
:confused:

推荐答案

消息管理可能位于OS内核中,我认为... :)
但是窗口的消息反应(对话框)
将在其创建的线程中被调用:)
The messages management may lie in the OS core, I think... :)
But the message reactions of a window (dialog)
will be called in thread of its creating :)


[ ^ ]对其进行解释


我可以为您详细解释

看,只有一个队列(默认情况下)紧随消息映射(所有Win32/MFC App中已经存在).对于每个控件/项目或过程,消息映射都得到了更新(我们也可以更改顺序)映射到消息映射表中的项目或相应地自定义消息映射表的项目).有两个API函数负责从对话框到队列或从队列到对话框传送消息,它们是PostMessage()和GetMessage().还有很多宏,它们负责路由那些消息.

我们还可以使用MSMQ&System.Messaging.dll创建自定义的消息队列,以便在这些队列中存储大量消息以进行本地系统数据存储.

/*如果(((this.Info ==有用)||(需要更多信息))
{
MessageBox(请让我知道");
}
*/
I can explain you it in details

Look, there is Only one queue (by default) that follow a message map (which is already there in all Win32/MFC App.), for each controls/items or for process, message map got updated (also we can change the order of items mapped inside the message map or customized that message map accordingly). there is two API functions responsible for carrying messages either from dialog to queue or from queue to dialog, they are PostMessage() & GetMessage(). Also there are many macros are there, which are responsible for routing those message.

Also we can create customized message queues using MSMQ & System.Messaging.dll , for storing a huge volume of messages inside those queues for Local System data Storage.

/*If ((this.Info == useful) || (need any more info))
{
MessageBox ("plz let me know");
}
*/


这篇关于消息队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆