RosettaCodeData/Task/Determine-if-only-one-instance-is-running/PureBasic/determine-if-only-one-instance-is-running.basic
2023-07-01 13:44:08 -04:00

11 lines
220 B
Text

#MyApp="MyLittleApp"
Mutex=CreateMutex_(0,1,#MyApp)
If GetLastError_()=#ERROR_ALREADY_EXISTS
MessageRequester(#MyApp,"One instance is already started.")
End
EndIf
; Main code executes here
ReleaseMutex_(Mutex)
End