* At the beginning of your Main Prg IF IsRunning(SomeUniqueForApplicationString) MessageBox("Application is already running") QUIT ENDIF FUNCTION IsRunning(tcSemaphoreName) LOCAL lpszSemName #Define ERROR_ALREADY_EXISTS 183 Declare Integer GetLastError In win32API Declare Integer CreateSemaphore In WIN32API ; string @ lpSemaphoreAttributes, ; LONG lInitialCount, ; LONG lMaximumCount, ; string @ lpName app_href = CreateSemaphore(0,0,1,tcSemaphoreName) RETURN (app_href # 0 .AND. GetLastError() == ERROR_ALREADY_EXISTS)The original code of that function is made by Cetin (I think), at least I get it from his post here.