Application opens more than one instance in Windows

Just realized my application will open twice (or more) in Windows.

Click the desktop Icon, app opens. Click it again, another instance of the app opens.

This does not happen on OS X (if you click the app icon in the dock and the app is already open, OS X just switches back to instance you already have open.)

I’m sure there is a simple solution, just don’t know what it would be.

Any help would be appreciated.

See the Notes on the Mutex docs.

In the app open event, this works for me:

//=========================================================== // Lets create a mutex so the application can't run more than once at the same time //=========================================================== MyMutex = new Mutex("MyAppMutex") If not MyMutex.TryEnter then If MsgBox("We've detected that this application is already running on your computer"+EndOfLine+EndOfLine+_ "If this is not the case, a reboot may clear up this problem",64, "Error Encountered") = 0 then End If Quit(1) End If