3

Okay, here's my situation. I have a WPF app that I have created that also includes an application protocol handler so that the app can be opened from links on the web that opens the app with command-line parameters to pre-populate some information. All this is working.

What I would like to accomplish is this. If the user already has the application open, and they click another of these links, it will currently open a new instance of the app. What I would like to be able to is detect if an existing instance of the app running, and if so, send the appopriate values to that application instead of opening a new one.

I know how to check for the existence of an instace (I'm doing it in another application), but I can't figure out how to then send values to that application. Google hasn't been much help, and you guys have always been awesome. Thanks!

James

James McConnell
  • 2,180
  • 3
  • 19
  • 29

1 Answers1

2

There are different solutions for interprocess communication in .NET/WPF. Take a look at this other post: simple IPC mechanism for C#/WPF application to implement app CLI

Community
  • 1
  • 1
ggarber
  • 8,300
  • 5
  • 27
  • 32
  • This example (http://www.flawlesscode.com/post/2008/02/Enforcing-single-instance-with-argument-passing.aspx) seems to be the one to go with, shouldn't have any problem using it with WPF as opposed to WinForms. Marking this as the answer since it was the first response that contained the link. :) – James McConnell Jun 18 '09 at 18:49