RosettaCodeData/Task/Determine-if-only-one-instance-is-running/PureBasic/determine-if-only-one-instance-is-running.purebasic
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07: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