WPF编程-自定义控件 [英] WPF programming - Custom Control
本文介绍了WPF编程-自定义控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从WPF窗口向窗口应用程序发送消息?
我需要wpf中的控件设计师吗?
最好的问候!
谢谢.
Mahcyp !!!
How can i send a message from a window wpf to window application?
I need to a control designer in wpf?
Best regards !
Thanks.
Mahcyp !!!
推荐答案
WPF不基于Windows消息.但是,如果您具有窗口句柄(HWND),则可以将消息发送或发布到任何窗口应用程序.为此,您可以P/Invoke.
请在我对这个问题的回答中查看更多详细信息: [ http://msdn.microsoft.com /en-us/library/ms644950(v=vs.85).aspx [ http://msdn.microsoft.com/en-us/library/ms644944(v = vs.85).aspx [
WPF is not based on Windows messages. However, you can send or post message to any windowed application if you have the Window handle (HWND). For this purpose you can P/Invoke.
Please see further details in my Answer to this Question: A custom-paint WinForm that makes VS 2005 crash when every second time open it in From design view, why?[^]. Take a look at the Answer to follow-up question where I show DLL Imports usingSystem.Runtime.InteropServices
.
For details on native Window API, see http://msdn.microsoft.com/en-us/library/ms644950(v=vs.85).aspx[^], http://msdn.microsoft.com/en-us/library/ms644944(v=vs.85).aspx[^].
The above answers the first question about sending a message. Sorry, I fail to understand your second question, please clarify.
—SA
这篇关于WPF编程-自定义控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文