I have problem with passing arguments into my program. Example: there are some mp3 files in some folder. My program is set to be a default program. If I select only one file and double click it, everything works fine. The problem is with more than one selected file. When i select more files and enter them, it starts its onw instance of program for each selected file. Is there any possibility to pass them as string array via command line args?
Edit:
run only one instance of my program I use
Process[] proc = Process.GetProcessesByName("MKMusicPlayer");
if (proc.Length > 1)
{
MessageBox.Show("Program is already running!");
proc[1].Kill();
}
and to get args
if (Environment.GetCommandLineArgs().Length > 1)
{//code}