SendMessage与PostMessage有什么区别啊?

解决方案 »

  1.   

    SendMessage需要立即返回,而PostMessage只管发出,不管接受
      

  2.   

    SendMessage是发送一个消息到消息链中,等待窗口函数来处理,而PostMessage是明确指出
    发送给谁,由它的窗口函数来处理.
      

  3.   

    SendMessage
    The SendMessage function sends the specified message to a window or windows. The function calls the window procedure for the specified window and does not return until the window procedure has processed the message. The PostMessage function, in contrast, posts a message to a thread's message queue and returns immediately. 
    PostMessage
    The PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and then returns without waiting for the thread to process the message. Messages in a message queue are retrieved by calls to the GetMessage or PeekMessage function.