[SOLVED] Detect an unrelated running process lazarus / 34-Windows ---------------------------------------------------------------------- fatmonk · 2015-01-19 16:36 Is there a simple way to check if a process is currently running on a Windows system? Specifically I want to check if Mozilla Thunderbird is running before a little Lazarus written app does something so I'd like to check to see if it's running or not. Thanks, FM ---------------------------------------------------------------------- minesadorada · 2015-01-19 17:10 This code works for me.  Pass the function just the EXE name - no need for a path.  It returns zero if the app is not running, else > 0 Code: [Select]Uses  ....Windows, JwaTlHelp32.... function WindowsAppIsRunning(const ExeName: string): integer; var   ContinueLoop: BOOL;   FSnapshotHandle: THandle;   FProcessEntry32: TProcessEntry32; begin   FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);   FProcessEntry32.dwSize := SizeOf(FProcessEntry32);   ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);   Result := 0;   while integer(ContinueLoop) <> 0 do     begin     if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =       UpperCase(ExeName)) or (UpperCase(FProcessEntry32.szExeFile) =       UpperCase(ExeName))) then       begin       Inc(Result);       end;     ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);     end;   CloseHandle(FSnapshotHandle); end; ---------------------------------------------------------------------- fatmonk · 2015-01-23 11:34 PERFECT! That works brilliantly. Thanks, FM