After playing with the new Windows Form project, I found that when you associate a file type with an executable file in Windows, you can find the file path of the file that launched the application using args[0] from static void Main(string[] args)
Is it possible to fire an event in an application by double-clicking a file if your application is already open? (As obvious, Main(string[] args) will not run).
Example application with the behavior I'm trying to replicate:
- User opens GIMP (on Windows)
- User opens explorer and right-clicks .png file
- User selects open using GIMP
- Instead of creating a new instance of the GIMP application, GIMP opens the image in a new window in the GIMP instance that has already been opened.
In this case, does GIMP use several applications to receive files βopenβ with file associations? Or it can be done with a single application instance.
I am having problems with this, since most of my search queries tend to lead me to associate files as a Windows user (ie, βHow to link .xls files to excelβ).
James source share