Re: Monitor a child process of a parent process,...




"Kerem Gümrükcü" <kareem114@xxxxxxxxxxx> wrote in message
news:Oy1lQ$RfHHA.1388@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

how do i programmatically monitor a child process
of a parent process? I assume that i have to use
some of the synchronistaion functions like
"WaitForSingleObject(...)." I want to start monitoring
right when the parent process starts the child process.
And i want to catch the processess termination.
In my case the parent is a console (cmd.exe) and the
child is some Win32 Application i wrote, that on
successfully execution finishes returns "0" and on Error
the result of GetLastError(). What do you recommend,...

The command line is the following:

cmd.exe getobjectnamespaces.exe > LastObjects.log

Parent here is of course the "cmd.exe" and the child is
the"getobjectnamespaces.exe".
I want to catch the "getobjectnamespaces.exe" termination.

I know that i could use some sort of output redirection
with Handles/Pipes, CreateProcess, ReadFile/Console/Pipe, etc,
but i wont for some special reasons. I use the redirection
operator in my case...

Open a handle to the process and wait for it to be signaled.

--

- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools




.



Relevant Pages

  • Monitor a child process of a parent process,...
    ... how do i programmatically monitor a child process ... right when the parent process starts the child process. ... I know that i could use some sort of output redirection ...
    (microsoft.public.win32.programmer.kernel)
  • Re: A tricky problem about Process.wait and popen
    ... There is a parent process and a fixed number of child processes. ... using IO.popen and then wait for any child process exits. ... it will read correspondant pipe to get result ... puts "Started" ...
    (comp.lang.ruby)
  • Re: DEFUNCT Processes
    ... When a child process dies the parent process gets notified with a signal ... The child process stays as DEFUNCT in the ... handler for SIGCHLD to IGNORE. ...
    (comp.unix.aix)
  • Re: WIndows process table and process image.
    ... the child process won't go away as long as the parent process is alive. ... only the child process is listed in process list without ... Please help me understand how Windows process is managed. ... Is there a zambie process in Windows as unix? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: fork and pipe
    ... In summary, the pipe(2) call creates a single, unidirectional pipe, ... The parent process calls pipeto open two fds. ... the parent process calls forkto spawn a child process ... the child process inherits all open fds from the parent process, ...
    (comp.unix.programmer)