I'm able to get the PID of a processname (ex: winword.exe) but interested of getting the PID of winword.exe based on a specific filename, is this possible? I was able to look capture the PID from winword but if there are multiple instance I can't kill all instance but only a specific one. I'm not so familiar with Winapi handling, based on this post: Delphi Get the handle of a EXE he is trying to change his approach from 'Window name' to an Exe name. But parameter @processid needs to be specified. How can I get the processid in this case based on filename or window name?