将数据发送到其他进程WPF应用程序单 [英] Send data to WPF singleton application from other process

查看:170
本文介绍了将数据发送到其他进程WPF应用程序单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF单应用程序,其中只有一个实例是在任何时间运行时,如果用户试图启动另一个实例,我们检查,如果它已经然后在运行我们杀了这个新的进程,并带来正面现有之一。

I have a WPF singleton application, wherein only one instance is running at any time, if user tries to launch another instance, we check if its already running then we kill this new process and bring to front the existing one.

现在,我们有一个要求开/接入和发送消息(组参数),从另一个进程可以是XLS,字,或其他独立的应用中WPF应用程序。
我们还希望确保,如果该进程已经运行,这个过程应该听到的消息和响应。

Now, we have a requirement to open/access and send message (set of arguments) to this WPF application from another process which can be xls, word, or another standalone application. We also want to make sure that if the process is already running, that process should hear the message and respond.

任何想法,我们如何能够在实现它我们的WPF应用程序

Any idea how we can implement it in our WPF application

感谢

推荐答案

的可能是最可互操作的方式Windows正在使用的 WM_COPYDATA Windows消息在应用程序之间传输数据。

The probably most interoperable way on Windows is using the WM_COPYDATA windows message to transfer data between applications.

您可以找到一个示例的这里,另一个用于WPF正确的这里

You can find an example here and another one for WPF right here.

这篇关于将数据发送到其他进程WPF应用程序单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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