Have you tried tasklist -f in a cmd console to see what the output is???
Where did you get that code?
(But even running something like tasklist /fi "IMAGENAME eq project1.exe" it will give you several lines)
BTW. You don't even need to have a FPC program to do this... you can just use a batch file.
Something like:
tasklist /fi "ImageName eq MyApp.exe" /fo csv 2>NUL | find /I "myapp.exe">NUL
if "%ERRORLEVEL%"=="0" echo Program is running
But then with a few extra lines to keep the batch running.
Notice it queries %ERRORLEVEL% to see if the
find is successful.
So if you are doing this in FPC, you need to query the output to see if your process is in that output.
And yes... if this is for your own program... Mutex'es might be a better way to go.