Q: How can I limit my application to one instance?
A: You need to create a named mutex semaphore when you start your application. When the second one starts it tries to get access to the mutex but will fail...
class CYourApp : public CWinApp
// Create mutex
hMutex = ::CreateMutex(NULL, TRUE, "GlobalMutex");
// Mutex created successfully. There is no instance running
// Mutex already exists so there is a running instance of our app.
// Failed to create mutex by unknown reason