0

I know there is a question with the following title: "Opening a file in an application that is already running"

This gives the answer to the question targeting WPF applications. I am working on a WinForms application where doubleclicking a specific file should start the program and open the file. Of course this is simple. Now when the application is already running I would like to open a file in the running application when it is doubleclicked.

To do this the application needs to be a singleton. I prefer the Mutex approach as described in this great article of "Sanity Free Coding"

Now I would like to know how to open a doubleclicked file into the running singleton WinForms applications. Any help would be appreciated.

0

1 Answer 1

1

I think this project does what you want. Also, you should get the file opened as a parameter for your singleton instance. I have not tested it though, use another implementation but I don't need more parameters from the second instance.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.