Terminating a process 
Author Message
 Terminating a process

I have a GUI which creates a batch file pending a users request.  I'm
using CreateProcess(); to spawn the call.  Once the natch file is
executes it creates some addtitonal child process and runs in the
background.  **THE CHALLENGE**  When the user exits the program it ask
if they want to terminate all background processes, if they click on yes

the program terminates the parent window(process) using
TerminateProcessbut the child process remain and contunue functioning.

**THE QUESTIONS**

    When the parent window is destroyed, shouldn all other child process

terminate ?

    Is there a way to grab a handle to the child processes and terminate

them seperately ?
    If so how.....  (please provide code)....

    Is there w way to grab a handle to the child processes and retrieve
information on the.
    i.e(executable name, processID) as displayed in task mamager, then
terminate them based
    if the executable name of the process meet a certain criteria ?????
    If so how.....  (please provide code)....

Thanks in advance for any information provided in this matter.



Sun, 15 Apr 2001 03:00:00 GMT  
 Terminating a process
in the CreateProcess() function, one argment is LPPROCESS_INFORMATION, a
pointer to the stuct  PROCESS_INFORMATION. In this struct, you can find the
new process handle.

I think you need to explicitly terminate a process created by this function.
In your case, you may create a new thread instead of a process. All threads
will terminate automatically if the parent exits.

zili

Quote:

>I have a GUI which creates a batch file pending a users request.  I'm
>using CreateProcess(); to spawn the call.  Once the natch file is
>executes it creates some addtitonal child process and runs in the
>background.  **THE CHALLENGE**  When the user exits the program it ask
>if they want to terminate all background processes, if they click on yes

>the program terminates the parent window(process) using
>TerminateProcessbut the child process remain and contunue functioning.

>**THE QUESTIONS**

>    When the parent window is destroyed, shouldn all other child process

>terminate ?

>    Is there a way to grab a handle to the child processes and terminate

>them seperately ?
>    If so how.....  (please provide code)....

>    Is there w way to grab a handle to the child processes and retrieve
>information on the.
>    i.e(executable name, processID) as displayed in task mamager, then
>terminate them based
>    if the executable name of the process meet a certain criteria ?????
>    If so how.....  (please provide code)....

>Thanks in advance for any information provided in this matter.



Mon, 16 Apr 2001 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. Terminate a process:

8. About terminate a process:

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

10. Cannot terminate a process.

11. How to terminate a process?

12. Terminate a process?

 

 
Powered by phpBB® Forum Software