How to get the Processing ID of a running exe file and kill the file?

I'm writing a small programmme that finds the pid of a ruuning exe file and then kills the file. I can't seem to ge the pid of the file. I'm not too sure if this is to do with how I'm trying to find the file. Any help woulf be appreciated. My code fails at the getting file process ID stage.
Last edited on
Once the function fails you need to call GetLastError() to get the error code, otherwise you'll never know why it failed and what you need to fix.
Thanks I figured it out
Last edited on
Registered users can post here. Sign in or register to post.