I have two C# applications (Windows Forms). Both developed by myself. I want one application to launch the other and open a form related to a parameter passed from first application. If second application is already open, then I need only to open the form in second application and get it to front.
Asked
Active
Viewed 177 times
1
-
Search for Inter process communication using C# – Habib Oct 30 '12 at 09:17
-
What types of C# applications are you referring to? Console Applications? Forms Applications? Web Applications? There are quite a few C# applications and the answer may differ in function of their type. – Coral Doe Oct 30 '12 at 09:25
2 Answers
1
What you need to archieve this is
that your 2 c# applications
support command line arguments
and are able to communicate together
Main() and Command-Line Arguments (C# Programming Guide)
look also at Data Copy

codeteq
- 1,502
- 7
- 13
-
Command line Arguments I agree, but it is only for first launch. What we can do if it is already running ? – Buddhi Dananjaya Oct 30 '12 at 09:26
-
-
of course, but you have to use p/invoke. In the interprocess communications link are some different ways for archieving this. Also good approaches are Remoting and Pipes! – codeteq Oct 30 '12 at 09:37
0
First step:
Launch an application if not launched
1)Determine, if application is running: Answer here
2)If is not runnign, run application: MSDN Example
Second step:
Then try named pipes for interprocess communication: Example here