(Q) How to terminate a Process 
Author Message
 (Q) How to terminate a Process

Hello everybody!
I need to write an application that can terminate processes - like the
End Task in Win 95.
Can enyone help ?
Thank you in advance.

Yair



Thu, 17 Aug 2000 03:00:00 GMT  
 (Q) How to terminate a Process

Take a look at the TerminateProcess function.  You can use the FundWindow
(or EnumWindows) functions to find the available windows, then use
GetWindowThreadProcessId to get its processid for use in terminateprocess

NOTE - it is bad procatice to call TerminateProcess unless teh application
has stopped responding.  TerminateProcess just kills the app, it doesn't let
it save data or anything.  You should post a quit message to the window

--
Diplomacy is saying 'nice doggy' until you find  a rock
 ------------------------------------------------------------
| Author for Pinnacle Publishing "Visual C++ Developer"     |
| http://www.pinpub.com/                                    |
| http://lucifer.lotus.com/jim/main.htm                     |
 ------------------------------------------------------------



Thu, 17 Aug 2000 03:00:00 GMT  
 (Q) How to terminate a Process

Quote:
>I need to write an application that can terminate processes - like the
>End Task in Win 95.

Yair,

You should first try to politely ask the program to terminate - if it
has a window then try posting a WM_CLOSE message to it. If that fails
then you can use TerminateProcess.

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Fri, 18 Aug 2000 03:00:00 GMT  
 (Q) How to terminate a Process

See this KB article " HOWTO: Terminate an Application "Cleanly" in Win32"
ID :Q178893.. You can find it at
http://support.microsoft.com/support/kb/articles/q178/8/93.asp
HTH

--
Girish Bharadwaj [VC++/MVP]

Quote:

>Hello everybody!
>I need to write an application that can terminate processes - like the
>End Task in Win 95.
>Can enyone help ?
>Thank you in advance.

>Yair




Fri, 18 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Terminating a child process

2. Process suddenly terminates without notification

3. terminate process

4. Debugged Process will not Terminate under Win2K

5. Process suddenly terminates without notification

6. Terminate Process and SecurityIno ?

7. Find and terminate a process under WIN98

8. How to terminate a process

9. terminating an out of process application

10. Terminate process (WaitableTimer)

11. terminate or Exit process, need help!

12. Terminate or Exit Process, need help!

 

 
Powered by phpBB® Forum Software