如题,
谢谢.

解决方案 »

  1.   

     SendMessage 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
      

  2.   

    SendMessage(hwnd,WM_QUIT,wParam,lParam)是直接投递WM_QUIT,属紧急消息,让程序要马上处理。PostQuitMessage(0)是把WM_QUIT消息放入消息队列,但是并一定会立刻响应。一般情况下看不出什么区别,但是如果消息处理得很多,队列中消息数量较大的话,要立刻关闭就得SendMessage
      

  3.   

    简单来说,SendMessage 就是我告诉你帮我做某事,你必须得告诉我个结果;
    PostMessage 就是我告诉你帮我做某事,但是结果你到底做了没有,我不知道,也不是很关心。
      

  4.   

    你可以把sendmessage看作是函数调用,是需要立即处理并返回结果,而postmessage是把消息放入消息队列,至于何时处理,是否处理,怎么处理一切不管。
      

  5.   

    SendMessage要等待返回,而PostMessage只管发送,你爱收不收!
      

  6.   

    但是我写SendMessage()的话程序不会退出,为什么呢?
    PostQuitMessage()会推出.