viewtopic.php?p=134940#p134940
V1 version of the re-run was able to exit correctly
But in the V2 version it exits but does not go to MsgBox(123) at all
I can't be sure if the exit is correct or caused by an error
V2:
Code: Select all
Persistent(true)
MutexName := "random"
If DllCall("OpenMutex", "Int", 0x100000, "Int", 0, "Str", MutexName)
MsgBox(123),ExitApp()
hMutex := DllCall("CreateMutex", "Int", 0, "Int", False, "Str", MutexName)
hMutex := DllCall("CreateMutex", "Int", 0, "Int", False, "Str", MutexName)
MsgBox(hMutex)
OnExit((*) => DllCall("ReleaseMutex", "Ptr", hMutex))
V1:
Code: Select all
MutexName := "random"
If DllCall("OpenMutex", "Int", 0x100000, "Int", 0, "Str", MutexName)
{
MsgBox 123
ExitApp
}
hMutex := DllCall("CreateMutex", "Int", 0, "Int", False, "Str", MutexName)
OnExit((*) => DllCall("ReleaseMutex", "Ptr", hMutex))
Sleep, 1000000