All those solutions (except for the semaphore) don' really help. You can easily copy/paste/rename the executable and run a second instance that way. To check whether another instance is already running, I suggest to create a mutex with a known name and check if that operation worked (there was no mutex with the same name, so also no other instance) or not (other instance with same mutex name already running).
- Code: Select all
For more documentation, see MSDN.