By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

How do i terminate/kill a process based on its windows caption - C++

P: 2
Hi,How do i terminate/kill a process based on its windows caption - C++ ? Would anyone mind posting an example source code of it?

E.g I do not want calc.exe to ever run in my pc so i want to create a program that detects for the caption name Calculator and also detects the exe name,if found,it kills the process ( calculator) . Thanks
Mar 17 '07 #1
Share this Question
Share on Google+
3 Replies


cyberking
P: 84
Hi,How do i terminate/kill a process based on its windows caption - C++ ? Would anyone mind posting an example source code of it?

E.g I do not want calc.exe to ever run in my pc so i want to create a program that detects for the caption name Calculator and also detects the exe name,if found,it kills the process ( calculator) . Thanks
Hi,

Well, I shall not be of much help to u. But from what you say here, I can say that you shall have to make that Killer program of yours to start of with system logon itself because your program shall be runnin in the background all the time. And as soon as the calc.exe (for eg.) is loaded, your program which is memory resident shall detect and Kill the process. But what's gonna be there in your program, I known nothing.

Also, I would love to see suggestions cos this is a very interesting query and I too would like doing something like this as long as its not meant to be malicious..

Regards
CyberKing
Mar 17 '07 #2

P: 2
Hi,

Well, I shall not be of much help to u. But from what you say here, I can say that you shall have to make that Killer program of yours to start of with system logon itself because your program shall be runnin in the background all the time. And as soon as the calc.exe (for eg.) is loaded, your program which is memory resident shall detect and Kill the process. But what's gonna be there in your program, I known nothing.

Also, I would love to see suggestions cos this is a very interesting query and I too would like doing something like this as long as its not meant to be malicious..

Regards
CyberKing
Well,this is basicly going to be a anti-cheat program for gamers,what it does is check if any of the third party cheat program is running or trying to load and it will kill it.Furthermore,it will also scan the game for any specific(offsets) modified data and if there is,the game closes.This is just a begining for me,after i learn and get more experience then probably i will try to develop some anti virus/firewall. So no,its not malicious. and btw How do you start it with system logon,i thought all you have to do is enable the priviliges
Mar 17 '07 #3

P: 93
There is a command taskkill in windows XP. I do not know whether such a command exists in other Windows versions. But you can use

Expand|Select|Wrap|Line Numbers
  1. system("taskkill [Parameters]");
  2.  
To get the job done if you know the actual name or process ID of the program you want terminated.
Mar 19 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.