Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Kill process in win2000

Status
Not open for further replies.

rksharma

Programmer
Dec 17, 2000
12
US
I have a program wherby you can close the window but the application stays active in the task list and has to be terminated.
I need to automate this.

eg. If the exe is called "abc.exe" then i nedd to parse the active processes and kil all the "abc.exes".
The window would have been closed.

How do you code this in Microsoft Bisual c++?

Thanks

Rocky.
 
If you dont have a user interface, for example a icon in system tray, then i would suggest creating a service out of you application. this can be stopped and started like any other service.

if you dont want to do this, then best create a system tray icon, with wich you are able to tell the application to stop.

if this has to be donne absolutely automatically, i think you dont get around programming a service.

Greetings
Remo
 
I agrre with your comments but it is an external application and we have no control over it. Hopefully it will get fixed in the future.
We cannot create a system try icon as it run on a citrix Nfuse portal where the user does not get the normal desktop.

Thanks


Rocky.
 
Well then, thats bad... I only can give you a hint. I never made it myselfe till now, but look on the internet for "enumerating processes" or something like this.

may you will be able to find anything on codeguru.earthweb.com or
Hope this helps
Greetings
Remo
 
You can do it using CreateToolhelp32Snapshot(), Process32First() and Process32Next().
 
Just get the applications processID, and then use the TerminateProcess() function.
 
Thanks.

The
CreateToolhelp32Snapshot(), Process32First() and Process32Next().

functions work fine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top