Ok, so I have an application that – at start up – checks for other instances of the program using the Mutex “solution”. So when I start the second instance of my program, I get a popup message telling me to … well whatever.
However, how do I handle it when I want to open a file in my already open instance, by double clicking the file in explorer? (Like Excel)
I guess that the solution must be some sort of message handler between the “old” instance and the new, where the new tells the old to open file xxx. Or is there any other way?
You will need to send a message to the first instance to tell it to open the file. Use one of the IPC mechanisms available in Windows or your favorite class library. A socket or pipe is the usual approach.