Returns if a process is already running when the same process is started again (singleton), process name may include path, when no processes given @ScriptName is used
Miscellaneous.au3 _ProcessRunsAlready( [$cProcessName1 [, $cProcessName2] [, $cProcessName3]]] ) |
$cProcessName1 | Name of process (executable, may include path) |
$cProcessName2 | Equivalent name of process (executable, may include path), for instance 32 or 64 bit version |
$cProcessName3 | Equivalent name of process (executable, may include path), for instance 32 or 64 bit version |
boolean value | True if process is already running thus 2 or more times as the current instances is also running for checking |
_ProcessInstances, _ProcessGetProcessId
; After Peace is started check if this Peace.exe is the only instance
If _ProcessRunsAlready("Peace.exe", "Peace64.exe") ; Check if one other or
more instances are running (any 32 or 64 bit version)
MsgBox($MB_OK, "Peace", "Peace is already running")
Exit
EndIf
; go on to show interface, etc.