关于多线程中消息的问题,
我在看多线程的时候,经常遇到诸如postmessage, sendmessage,postmessage,transmitmessage,peekmessage等消息函数,谁能帮我解释一下,他们的意思及作用。高手请解释!
在编程的时候遇到这样一句:
renturn  (UINT)-1;DWORD和LONG的区别,Char和byte的区别
什么意思?

解决方案 »

  1.   

    DWORD是usigned long,UINI是usigned int,在32位操作系统中,他们的字长是一样的。
    LONG合DWORD,char和BYTE都是带符号和不带符号的区别。
    (UINT)-1是把-1转换无符号整数,-1在内存中二进制表示为0xffffffff,本来是带符号整数,最高位做符号位,化为无符号整数后,最高位也成了数据位,值就变成了正的4294967295,即2的32次方减1。
      

  2.   

    steedhorse(晨星) is right!=============================================================================PostMessage不必等到消息函数执行完毕,MSDN中这样说:
    The PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message. =============================================================================SendMessage要等到消息函数执行完毕才返回,接着执行下一步:
    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.=============================================================================关于PeekMessage等,本人对此了解不是很深,因此你看MSDN吧
    那里说的我觉得已经很明白了=============================================================================多看看MSDN吧编程快乐