Sign in to follow this  
Followers 0
trasko

Send Ctrl-c To Window By Pid

2 posts in this topic

Hello, I apologize if this has been covered before. Lots of searching left me w/o anything really close to what I am looking for...

Here is what I want to do: I have the PID of a process running in a command window on an XP machine. What I really want to do is send that PID whatever signal it gets when you press "control-c" (ctrl-c, etc).

I thought it was possible to pull the title of the command window this process is running in by using "tasklist /V", but it ends up you can only get the title from the "cmd.exe" process and not the process running inside of it. Bleh!

Is there a more direct way of doing this? Perhaps a way to select a window based upon what processes are running in it / associated with it? Is there another way I can send the equivalent of ctrl-c to the process?

Thanks!

Share this post


Link to post
Share on other sites



What you're looking for is a inverse WinGetProcess .. but honestly, i've been looking at it, and i have no idea what to do ..

tasklist /V can be replaced by ProcessList

You may also want a quck look at _ProcessGetName

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0