File Association: Mulitple files in one commandline

JumpyNET

Centurion
Joined
Apr 4, 2005
Messages
196
Currently when I select and open multiple files in windows explorer at once, it opens them in separate processes.

Is it possible to associate windows explorer to launch only one instance of my application with all the selected files in the commandline?
 
You must handle this from within your application.
If it's a single instance, consider using NextInstanceRequested and CommandLine.
A search on MSDN will give you what you want.
 
You must handle this from within your application.
If it's a single instance, consider using NextInstanceRequested and CommandLine.
A search on MSDN will give you what you want.

I don't think there is such thing as NextInstanceRequested. MSDN ended up with no result.
"We're sorry, we couldn't find any results containing NextInstanceRequested"

Did you mean Private Sub MyApplication_StartupNextInstance? I tied using that, but it seems way too slow. If I open 30 files associated to my program at the same time my app simply freezes.



PS: I did not forget to change my app to Single instance application.
 
Even if you want to open a lot of files together at once, Windows will prompt a warning:
"Choosing to "YourAction" "NumberOfFiles" at once may take a long time and cause your computer to respond slowly".
However, even if some exception like "Microsoft.VisualBasic.ApplicationServices.CantStartSingleInstanceException" occur, you can catch it!
And this is the URL to the help page on MSDN:
http://msdn2.microsoft.com/en-us/li...ices.startupnextinstanceeventargs(VS.90).aspx
 
Back
Top