Send parameters to a running application in C#

断了今生、忘了曾经 提交于 2019-12-04 17:06:45

the easiest and for me the most reliable way to send other applications a message... is to use the WM_COPY event. You can get to this with some old school API calls.

Still valid in Windows 7 We implemented this same thing in a recent application and it works flawlessly on all windows platforms. (tested back to windows xp, but have use the same api in windows 98)

Here is a link to codeproject.

http://www.codeproject.com/KB/cs/ipc_wmcopy.aspx

Essentially register a window in the applications and send messages to that window. Then you can filter it down to the applications.

Pretty cool, and quite efficient. With a little tooling you can make an unlimited amount of application instances communicate with each other.

A message queue is a common pattern to communicate between processes. Volure's version of that is cool. A more common approach is to use MSMQ (Microsoft Message Queueing).

Check it out here

http://msdn.microsoft.com/en-us/library/ms978430.aspx

http://en.wikipedia.org/wiki/Microsoft_Message_Queuing

http://blog.goyello.com/2009/09/08/why-msmq-is-excelent-for-net-developers/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!