Since we are on windows.
uses JwaTlHelp32, Windows;
function IsProcessRunning(PID: DWORD): Boolean;
var
pProc: TProcessEntry32;
pSnap: THandle;
pBool: BOOL;
begin
Result := False;
pProc.dwSize := SizeOf(pProc);
pSnap := CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
pBool := Process32First(pSnap, pProc);
while Integer(pBool) <> 0 do
begin
{ShowMessage('PName: ' + pProc.szExeFile + sLineBreak +
'PID: ' + IntToStr(pProc.th32ParentProcessID) + sLineBreak +
'PARENTID: ' + IntToStr(pProc.th32ParentProcessID));}
if pProc.th32ProcessID = PID then
begin
Result := True;
Break;
end;
pBool := Process32Next(pSnap, pProc);
end;
CloseHandle(pSnap);
end;
Just make a PID list with your processes, you can check which one is running from time to time.