Is there a way to call method inside a running .NET assembly.
The problem is that I have a .NET application that is run on system startup and puts itself in the system tray. The user can open the application dialog by double-clicking on the tray icon but I want to show the form even when the user start the application again (and its already running). Currently in the main method, I get the running .NET assembly as Process but dont know how to get a reference to the internal class/methods.
I am able to get whether an instance is already running but want to know how to call methods from the process handle that I have. When its the second instance, I check all the running processes and get a pointer to my already running process. I was wondering if there is a way in .NET (thorough reflection or something else) that will use this process handle and return me a pointer to an interface.
-Added 7-Apr-09- There are a number of solution to find whether an instance is already running but what I really want is to cast the process into some interface and call a method on it. OR Pass a message into the running application with some parameters.