Terminate a process? 
Author Message
 Terminate a process?

I've startet an application with ShellExeceuteEx and got the ProcessID.
Now I've tried to terminate that application by
TerminateProcess(ProcessId) and CloseHandle(ProcessId). All seems to work
well, but if I try to start that application a second time, it semms,
that there are some handles of that application still open, so I get
errors. That application is not a program of mine, so how can I be sure
to close all handles of startet application?

Are there any solutions?

Thanks, Wernfried



Sun, 30 Jun 2002 03:00:00 GMT  
 Terminate a process?

Quote:

>I've startet an application with ShellExeceuteEx and got the ProcessID.
>Now I've tried to terminate that application by
>TerminateProcess(ProcessId) and CloseHandle(ProcessId). All seems to work
>well, but if I try to start that application a second time, it semms,
>that there are some handles of that application still open, so I get
>errors. That application is not a program of mine, so how can I be sure
>to close all handles of startet application?

Don't use TerminateProcess() ;>

TerminateProcess does not do anything to allow
the app to clean up. Use SendMessage with
WM_CLOSE. This tells the app to end itself.



Sun, 30 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Find and terminate a process under WIN98

2. How to terminate a process

3. Terminate the process using WaitableTimer

4. How to terminate a Process by Name ??

5. terminate a process

6. How to terminate a process?

7. Terminating a process

8. Terminate a process:

9. About terminate a process:

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

11. Cannot terminate a process.

12. How to terminate a process?

 

 
Powered by phpBB® Forum Software