Determine if the executable is running
On the path to the executable file, we determine whether it is running.
1 2 3 4 5 6 7 8 9 10 11 12 |
Uses Winapi.TlHelp32; ... var exePath: WideString; pid: Integer; begin exePath:= 'C:\Windows\explorer.exe'; pid:= isExeRunning(exePath); if pid <> 0 then ShowMessage('The file is running') else ShowMessage('The file is not running'); end; |