-
August 1st, 2007, 08:42 AM
#1
How to Find PID
Hi
I am opening the 3 note pad and the three process are running in task bar
i.e notepad.exe(3), so i want to get the pid of second note pad and kill that processs manually.
I don't want to kill another two process those are running in task bar i.e notepad1 and notepad3 these are remine run in task bar only that notepad2 is kill
please suggest me How will i kill this one programmtically.
Thanks
Anand
-
August 1st, 2007, 08:52 AM
#2
Re: How to Find PID
Originally Posted by anandtugaon
Hi
I am opening the 3 note pad and the three process are running in task bar
i.e notepad.exe(3), so i want to get the pid of second note pad and kill that processs manually.
I don't want to kill another two process those are running in task bar i.e notepad1 and notepad3 these are remine run in task bar only that notepad2 is kill
please suggest me How will i kill this one programmtically.
Thanks
Anand
have a look process
-
August 1st, 2007, 09:29 AM
#3
Re: How to Find PID
Adding to what Ashish wrote, you can use TerminateProcess API to end it.
Regards,
Ramkrishna Pawar
-
August 1st, 2007, 10:33 AM
#4
Re: How to Find PID
Hi krishanna,
I knew we can use these API's to kill process
1)EnumProcesses
2)OpenProcess
3)EnumProcessModules
4)GetModuleBaseName
5)TerminateProcess
I am asking, I am opening 3 notepad, i it will create three running notepad.exe, i want to kill second notepad.exe i wont to kill another two notepad.exe( i. e 1st and 3rd ).
using this we can kill all three notepad.exe
So my main question is, How to kill 2nd notepad.exe ?
-
August 1st, 2007, 12:09 PM
#5
Re: How to Find PID
Well, I cannot see what's the difference between 1st and 2nd Notepads? The time of appearing? Then you run your program in background and register new Notepad appearing. In case it's a third one, you already have PID1 and PID2. You enumerate top windows, find out the one that belongs to PID2 process and post WM_CLOSE to it. After closing the PID3 becomes PID2, and from this moment it is the first candidate for closing.
Easy thing...
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|