if ISAPPRUNNING() =MSGOK("Este aplicativo já está em uso.") quit endifHere goes the code for function ISAPPRUNNING()
function ISAPPRUNNING #define ERROR_ALREADY_EXISTS 183 declare integer GetLastError in WIN32API declare integer CreateSemaphore in WIN32API string @ lpSemaphoreAttributes, long lInitialCount, long lMaximumCount, string @ lpName C_SEMAPHOREID = "Put-Some-String-To-Uniquely-Identify-Your-Application-Here" N_RUNNINGPROCESS = CREATESEMAPHORE(0, 0, 1, C_SEMAPHOREID) return (N_RUNNINGPROCESS # 0 and GETLASTERROR() == ERROR_ALREADY_EXISTS)You have to change the "Put-Some-String-To-Uniquely-Identify-Your-Application-Here" for some string that identifies your application (for example "Mala Direta VFP")