Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

VS 2010 Open multiple files without starting multiple instances (Application.CommandLineArgs)

$
0
0
I have a program that handles a particular (custom) filetype and I can start my program by double-clicking on an associated file. I use My.Application.CommandLineArgs to get the name of the file that was clicked and this is then loaded. If the user clicks on a file when the program is already running, a second instance of the app is started and the second file is loaded. I would like just one instance of the app to run and for multiple files to be loaded into it. I can detect if my app is running with something like Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName) but I don't seem able to retrieve the name of the file that was clicked under those circumstances. Any pointers towards getting the name of the file that was clicked when my app is already running?

Thanks.

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>