是什么C#,WPF和纯粹的Windows编程发送消息和短消息功能,以及这些关系之间的区别? [英] What is the difference between Send Message and Post Message and how these relate to C# ,WPF and Pure windows programming?

查看:227
本文介绍了是什么C#,WPF和纯粹的Windows编程发送消息和短消息功能,以及这些关系之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么(在编程纯粹的Windows而言)发送消息和短消息功能之间的差异,以及这些涉及到C#,WPF和纯粹的Windows编程?

What is the difference between Send Message and Post Message ( in terms of pure windows programming) and how these relate to C# ,WPF and Pure windows programming?

我相信新的线程和所有相关的东西,所以请原谅我明显quesiton。
我需要挖掘出线程的外部。请让我知道,帮助我建立从Win32编程到WPF我的概念中的链接。

I am new to Threading and all related stuff so please excuse me for obvious quesiton . I need to dig out the externals of Threading .. Please let me know the links that help me to build my concept from win32 programming to WPF.

我需要从发布消息到AFX到underderstand(调用启动一个新的线程)委托Invok /开始Invoke来调度。

I need to underderstand from Post message to Afx ( call to start a new thread ) to delegate Invok/Begin Invoke to Dispatcher.

推荐答案

PostMessage的(以纯windows编程,又名WIN32 API)是的异步,也就是说,引用文档:

PostMessage (in "pure windows programming", aka win32 API) is asynchronous, i.e., to quote the docs:

位置(职位)的消息在与创建指定
窗口并返回,而不等待
中的线程来处理该消息的
线程相关联的
消息队列。

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.

要张贴在一个线程相关的消息队列
的消息,使用
PostThreadMessage功能。

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

SendMessage函数是的同步,就是再次报价:

SendMessage is synchronous, that is, again quoting:

发送指定消息到
窗口或窗口。该SendMessage函数
函数调用指定的窗口的窗口过程
和没有
返回,直到窗口过程已经
处理的消息。

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.

要立即发送一条消息,并返回
,使用
SendMessageCallback或
SendNotifyMessage功能。要发布一个
消息给线程的消息队列
并立即返回,使用
PostMessage的或PostThreadMessage
功能。

To send a message and return immediately, use the SendMessageCallback or SendNotifyMessage function. To post a message to a thread's message queue and return immediately, use the PostMessage or PostThreadMessage function.

在这两个功能一个很好的教程,其使用这里

A good tutorial on these two functions and their use is here.

要WPF的连接中的这太问题

这篇关于是什么C#,WPF和纯粹的Windows编程发送消息和短消息功能,以及这些关系之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆