How to terminate a process? 
Author Message
 How to terminate a process?

Hello,
does someone know how to terminate a process under Windows. The
information concerning the process I'm obtaining from the program
"ProcessViewer". I know the Process (e.g. WINMINE) and the PID (e.g.
FFE6DA1D).
Best regards, Raffael Vogler


Wed, 06 Oct 2004 01:26:58 GMT  
 How to terminate a process?
If you know the name of the window it is a whole lot easier.
you could just call FindWindow then send in a message

Like this:
HWND hwnd = FindWindow(NULL, "Window Name);
SendMessage(hwnd, WM_CLOSE, 0, 0);

With the PID method you have to do an enumWindows something or other to get
the handle
then call terminateProcess.

Regs,
Steven


Quote:
> Hello,
> does someone know how to terminate a process under Windows. The
> information concerning the process I'm obtaining from the program
> "ProcessViewer". I know the Process (e.g. WINMINE) and the PID (e.g.
> FFE6DA1D).
> Best regards, Raffael Vogler



Wed, 06 Oct 2004 04:06:44 GMT  
 How to terminate a process?
How do I get the PID from the Name of the Process? WINMINE is a bad
example because the process I want to terminate isn't a window.


Wed, 06 Oct 2004 17:30:08 GMT  
 How to terminate a process?
Be careful of FindWindow.

See http://www.pgh.net/~newcomer/nomultiples.htm#Why%20FindWindow%20doesn...

Jeff


| If you know the name of the window it is a whole lot easier.
| you could just call FindWindow then send in a message
|
| Like this:
| HWND hwnd = FindWindow(NULL, "Window Name);
| SendMessage(hwnd, WM_CLOSE, 0, 0);
|
| With the PID method you have to do an enumWindows something or other to get
| the handle
| then call terminateProcess.
|
| Regs,
| Steven
|


| > Hello,
| > does someone know how to terminate a process under Windows. The
| > information concerning the process I'm obtaining from the program
| > "ProcessViewer". I know the Process (e.g. WINMINE) and the PID (e.g.
| > FFE6DA1D).
| > Best regards, Raffael Vogler
|
|



Wed, 06 Oct 2004 17:43:54 GMT  
 How to terminate a process?
A process isn't a window. A process may *have* a window, and you might have meant that
"the process I want to terminate doesn't have a window", in which case you should describe
your actual problem and not suggest that you need a solution to a different problem.

However, one thing you can be sure of: if you need TerminateProcess, you are probably in
trouble. And if you aren't, you quite probably will be after you use it.

If you have created the program which is executed as the process you want to kill, this is
also useful, because the approaches you can take have more degrees of freedom if you are
controlling the source.
                                joe


Quote:
>How do I get the PID from the Name of the Process? WINMINE is a bad
>example because the process I want to terminate isn't a window.

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Fri, 08 Oct 2004 04:26:40 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Find and terminate a process under WIN98

2. How to terminate a process

3. How to terminate a Process by Name ??

4. How to terminate a process?

5. About terminate a process:

6. How to terminate a process created with CreateProcess(...)

7. Cannot terminate a process.

8. How do I terminate a process that I created

9. How to terminate a Process by Name ??

10. (Q) How to terminate a Process

11. How to terminate a process

12. How to terminate child process when calling process exits?

 

 
Powered by phpBB® Forum Software