[求助] SendMessage发送的消息是否会被GetMessage处理?
<P><FONT face="verdana, arial, helvetica" size=2>MSDN中有两段关于GetMessage与SendMessage的话:<br><br>1.---The SendMessage function is used to send a message directly to a window procedure. <br>The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message. <br><br>2.---The GetMessage function retrieves a message from the calling thread's message queue. The function dispatches incoming sent messages until a posted message is available for retrieval.<br><br>疑问:<br>即然第一句说Sendmessage函数将消息直接发送给Winpro函数处理的, 也就是不用经过线程消息队列喽, 但是上面第二这句话为什么又说当在线程消息队列中没有可用的Posted消息时, GetMessage函数会将Sent来的消息dispatch呢,这应该不属于GetMessage的责任啊? Sendmessage发来的消息应该与Getmessage函数没关系吧, 请问是我是否理解错误?<br><br>还有一个问题: 消息队列有系统消息队列和线程消息队列两种,我想问是不是所有的消息都要先进入系统消息队列, 然后再由系统将其post到相应线程队列或者直接send给winpro处理呢?谢谢</FONT></P>[align=right][color=#000066][此贴子已经被作者于2006-4-14 14:28:30编辑过][/color][/align]
相对于98的sendmessage的函数,nt内核的系统确实做了处理,但是还是可以通过一些手段,比如用系统钩子,但是直接使用<FONT face=Verdana size=2>Getmessage时截取不到的</FONT> <P>至于你后面的那个问题,那是肯定的,所有的消息包括系统自己的消息,都是要“排队”的,不过消息也有不同的优先级,系统会先处理优先级高的消息</P>
页:
[1]
