if IsAppRunning("Caption do seu Programa") this.ExecutarSeuPrograma() else this.AtualizarSeuPrograma() endif *** function IsAppRunning(IcAppScreenTitle) DECLARE INTEGER FindWindow IN Win32api STRING, STRING DECLARE ShowWindow IN Win32api INTEGER, INTEGER DECLARE SetForegroundWindow IN Win32api INTEGER nWinHandle = FindWindow(NULL, IcAppScreenTitle) IF nWinHandle <> 0 SetForegroundWindow(nWinHandle) *WAIT WINDOW 'Carregando ' + IcAppScreenTitle + '...' TIMEOUT 1 ShowWindow(nWinHandle, 9) RETURN .T. ELSE RETURN .F. ENDIF endfunc && function IsAppRunning(IcAppScreenTitle)