唯C更漂亮

VC。。。。。。

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  12 随笔 :: 0 文章 :: 6 评论 :: 0 Trackbacks

#

原文:
    SendMessage sends the specified message to a window or windows. 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.
译文:
     SendMessage将指定的消息发送到一个窗口或多个窗口。SendMessage为这个指定的消息调用窗口处理程序,直到窗口处理完这个程序后才会返回。和SendMessage函数相比,PostMessage函数发送一个消息到线程消息对列中,并立即返回。
辨析:
      shuishi32
在给出翻译的还给对ddlddy的问题:“我用SendMessage(hWnd,WM_QUIT,NULL,NULL)和PostMessage(hWnd,WM_QUIT,NULL,NULL)去关闭一指定窗口,SendMessage的不能实现,可以解释一下吗?我主要的就是想知道这个!”给出了解答:WM_QUIT是通知系统关闭,这个消息只有系统通过GetMessage来返回0达到线程关闭的。而SendMessage发送的消息不会到系统对列中,它只是处理,而PostMessage就会发送到系统队列中。 另外可以用SendMessage(hWnd, WM_CLOSE, 0, 0);来关闭对话框。



posted @ 2007-04-14 11:14 唯C程序猿 阅读(685) | 评论 (0)编辑 收藏

     摘要:   阅读全文
posted @ 2007-04-14 10:38 唯C程序猿 阅读(458) | 评论 (0)编辑 收藏

仅列出标题
共2页: 1 2