Until now I was using this function to kill a process. But what if I have three processes of the same name and only one of them is the one that I want to kill? If I will do this: KillTask('csrss.exe') then it will kill the system process. I have the path of my process, how can I use this information to kill it?
Iterate over processes and check the path for each of them, then use the answer from this SO question (use GetModuleFileNameEx):
get the full path from a PID using delphi
If you launched the process then remember the PID or Handle and kill the specific one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With