*** In My Main program PRIVATE lnHref IF __IsRunning([SomeUniqueNameOrSomething]) MessagerBox([Program already is in use]) RETURN .f. ENDIF *** In my clearing (shutdown program, or error routine or whenever I quoit the application): DECLARE CloseHandle IN WIN32API LONG hHandle CloseHandle(lnHref) FUNCTION __IsRunning(tcSemaphoreName) LOCAL lbReturnValue Declare Integer GetLastError In win32API Declare Integer CreateSemaphore In WIN32API ; string @ lpSemaphoreAttributes, ; LONG lInitialCount, ; LONG lMaximumCount, ; string @ lpName lnHref = CreateSemaphore(0,0,1,UPPER(tcSemaphoreName)) m.lbReturnValue = (lnHref # 0 .AND. GetLastError() == ERROR_ALREADY_EXISTS) RETURN m.lbReturnValueBut you should check for MUTEX because they give you more flexibility.