Slemke is right:
To detect existing application instances, use a global
mutex or semaphore object with a known name. Prefix the object's name with "Global\" to ensure that the global namespace is used. This allows you to detect instances of your applications that are running in separate user sessions.