Timing executable inside

Miscellaneous Forums/General Discussion/Timing executable inside

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Const ERROR_ALREADY_EXISTS:Int = 183

Extern "win32"
	
	Function CreateMutex:Int(lpMutexAttributes :Byte Ptr, bInitialOwner:Int, lpName : Byte Ptr) = "CreateMutexA@12" 
	Function GetLastError:Int() = "GetLastError@0"
		
End Extern

Local ret:Int = CreateMutex(Null,Null ,"ProgName".ToCstring())

;Put a window saying about 2 instances or whatever inside this test, then end.
If getlasterror () = ERROR_ALREADY_EXISTS

	End

EndIf