|
-
April 28th, 1999, 07:15 PM
#1
Terminating another Process in WIn95/98/NT
Hi!
i want to terminate another process from my own process, how can i do that?
i want to do it under win95/98 and NT.
thanks in advance.
-
April 28th, 1999, 11:39 PM
#2
Re: Terminating another Process in WIn95/98/NT
You can OpenProcess(...) and use the Handle to TerminateProcess(...) or ExitProcess(...). mail me the result to [email protected]
-
April 29th, 1999, 01:06 PM
#3
Re: Terminating another Process in WIn95/98/NT
Hi,
I strongly believe what you want to do is not such an easy task as dinesh had written. Its true that you have to use TerminateProcess() to kill another process. ExitProcess() is for terminating the application by itself. It can not terminate another application. TerminateProcess() has to use the Handle, but how to get the handle of other processes? You should have the ProcessId for that. Then the next question is how to get the ProcessID!! Haplessly there is no set of API's available common to Win NT4.0/95/98. In 95 and 98 you should use ToolHelp32 API's to get the ProcessId while in case of NT you should either use PDH(Performance Data Helper) APIs (I haven't used PDH APIs, but read about it in 98 Sept issue of MSJ) or Performance Monitoring feature of NT(Article by Jeffrey Richter in August issue of MSJ). I used the second method and succeeded to write a DLL which works fine for both NT and 95. According to Microsoft they hadn't time to incorporate ToolHelp32 APIs to NT4.0, but they have done it for 5.0/2000. If you send me your mail id I will send you the source code,
Ashley Antony
[email protected]
Robert Bosch India Ltd,
Bangalore, India.
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
|