I want to open files, which are doubleclicked in Explorer, in the same instance of my .Net application, e.g. in a new tab. How can I do this?
For now each file starts new instance of my application. Many programs can open files in the same instance, for example, Opera and Notepad++, so there is an easy way for sure.
To open a file with an application other than the default, right-click the file and select the application you want from the top of the menu. If you do not see the application you want, select Open With Other Application. By default, the file manager only shows applications that are known to handle the file.
You may take a look at this post which illustrates a technique that could be used to have a single instance WinForms application.
Might be an easier way to do it but the way I've done it is that if an instance is started with a filename as a parameter then it checks if there are any other instances and if so passes on the filename to that instance and the close itself down.
In case you want to do the same, but in WPF rather than WinForms, the howto is explained here: What is the correct way to create a single-instance application?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With