Files
harbour-core/contrib/hbwin/tests/mutexwin.prg
Przemysław Czerpak 96ca3fe470 2014-01-21 20:41 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* Makefile
  * config/*
  * contrib/*
  * doc/*
  * extras/*
  * include/*
  * lib/*
  * package/*
  * src/*
  * tests/*
  * utils/*
    * removed empty lines left after removed '$' + 'Id' + '$' identifiers
2014-01-21 20:41:05 +01:00

22 lines
426 B
Plaintext

#require "hbwin"
STATIC s_hMutex
PROCEDURE Main()
LOCAL cAppName
// It may be a random program name :)
hb_FNameSplit( hb_ProgName(), NIL, @cAppName )
s_hMutex := wapi_CreateMutex( NIL, NIL, cAppName )
IF ! Empty( s_hMutex ) .AND. wapi_GetLastError() == 0
? cAppName, "=> Hello World! OK."
ELSE
? cAppName, "=> Application is running. Error", wapi_GetLastError()
ENDIF
WAIT
RETURN