PostMessage与SendMessage

news/2024/6/17 7:42:34

 PostMessage消息发出后不等消息函数处理完就执行它的下一语句   
 SendMessage消息发出后阻塞等消息函数处理完执行它的下一语句

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.

To post a message in the message queue associate with a thread, use the PostThreadMessage function.

BOOL PostMessage(
  HWND hWnd,      // handle to destination window
  UINT Msg,       // message
  WPARAM wParam,  // first message parameter
  LPARAM lParam   // second message parameter
);

Parameters

hWnd
[in] Handle to the window whose window procedure is to receive the message. The following values have special meanings.
ValueMeaning
HWND_BROADCASTThe message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows.
NULLThe function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread.

Msg
[in] Specifies the message to be posted.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.

http://www.niftyadmin.cn/n/2095087.html

相关文章

Windows Server 2008 WDS实现跨网段实现远程部署

12.4 实战:跨网段实现远程部署 实战目标: u 如图12-146所示,实现跨网段的远程部署。 实战环境: 图12-146 真实环境 u DCServer是ess.com域的域控制器,安装Windows Server 2008企业版,安装DNS和DHCP角色。 u…

unresolved external symbol __beginthreadex错误的解决

unresolved external symbol __beginthreadex错误的解决Win32 Consle Application使用MFC的一些类如CString时编译时相信会很经常遇到一些连接错误:1. unresolved external symbol __beginthreadex2. unresolved external symbol __endthreadex但是不用…

一个超NB的轻松黑掉网站方法

一、打开你要黑的网站,如:http://blog.csdn.net/ 二、在浏览器的地址栏里输入: javascript: document.body.contentEditable"true"; document.designMode"on"; alert("you can modify this page now, as you wish.&…

新加坡与澳大利亚就网络安全开展深度合作

新加坡与澳大利亚两国签署了一份为期两年的网络安全合作协议,其内容涵盖信息交流、培训和联合网络演习等合作方向,以共同维护关键性信息基础设施安全。 在上周五召开的新加坡-澳大利亚领导人首脑会议上,两国总理共同见证了这份谅解备忘录&…

如何判断浏览器类型

<html xmlns"http://www.w3.org/1999/xhtml"><SCRIPT LANGUAGE"JavaScript">function IsIE(){if (window.navigator.userAgent.indexOf("MSIE")>1)//如果浏览器为IE{alert("IE浏览器");}else //如果浏览器为Firefox{if…

MFC下CSocket编程详解

1. 常用的函数和注意事项(详细的函数接口说明请查看MSDN): CSocket::Create 初始化(一般写服务器程序都不要用为好,用下面的 CSocket::Socket 初始化) CSocket::Socket初始化 CSocket::SetSockOpt 设置socket选项 CSocket::Bind 绑定地址端口 CSocket::Connect 连接 CSocket::L…

WSAEventSelect

WSAEventSelect FunctionThe WSAEventSelect function specifies an event object to be associated with the specified set of FD_XXX network events. 确定与所提供的FD_XXX网络事件集合相关的一个事件对象。 Syntax Cint WSAEventSelect(__in SOCKET s,__in WSAEVENT hEv…

批处理高级应用

批处理高级应用扩展名是bat(在nt/2000/xp/2003下也可以是cmd)的文件就是批处理文件。 首先批处理文件是一个文本文件&#xff0c;这个文件的每一行都是一条DOS命令&#xff08;大部分时候就好象我们在DOS提示符下执行的命令行一样&#xff09;&#xff0c;你可以使用DOS下的Edi…