Mutex different on debug than on release?
Posted on 2005-04-14
I have made a program that is only supposed to allow 1 copy to run at a time. Here is the Main()
static void Main()
Mutex m = new Mutex(true, "PgrRn", out mutexWasCreated);
// Another instance of the application already exists!
IntPtr hWnd = FindWindow(null, "Pgl");
if(hWnd != IntPtr.Zero)
ret = SetForegroundWindow(hWnd);
Everything works great in debug mode, but in Release, it allows more than one copy to start. Hmm...
I'm in a bit of a hurry, so i'll put the points up to 500.