I am working on a program that distributes source code.
It is only supposed to allow one instance, every subsequent instance is supposed to pass its command line to the first instance.
This part works (mostly)
The problem I encounter, is if you select several files in Windows, and choose to open them in the program, both detect each other as a previous instance and it fails.
What can I do to prevent this? I am currently using this as my code to detect a previous instance.
If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length > 1 Then
Return True
Else
Return False
End If