tags:

views:

40

answers:

3

I have WPF Application. My Application consist of 2 exe files: Notifier.exe and MainApp.exe. Notifier is system tray popup application which check the remote server in equal intervals and get the list of current documents of user. When user click on one of the documents in list in Notification popup I open MainApp.exe and show required document in new tab. But When user click on another document in list it open new MainApp.exe process. Question: How Can I connect specific (already opened) process in the operating system and create some object in it?

A: 

Let MainApp act as TCP server and Notifier be the client. Notifier shall send document info over a tcp session. If the MainApp is not running then Notifier can start MainApp via Process.Start().

this. __curious_geek
A: 

As i remember there is a trick in VB.Net to only allow one instance of an application, somehow this isnt in C#, i read about it somewhere.

You need to send a message to the WPF project that should open the new document, i suggest doing this by using WCF, make a service that can send a command to the WPF application that needs to open the document

H4mm3rHead
I did it in the past. But I cant find my codes. I remeber that was some pattern for this situation
Polaris
A: 

You can use named pipes (WCF) for transferring data from one instance to another.

Josip Medved