is this possible?

is this possible?

Post by mike » Mon, 19 Apr 2004 11:28:47


Hi,

i was wondering if this was possible...

i have an executable that spawns and monitors the spawned process. if it
takes longer than 30 seconds i kill this process and the main executable
exits. however what i now want to do is this.

if the main executable for some odd, unknown reason goes into a weird state,
i was going to kill it with TerminateProcess (). however i wanted to know if
it is possible to intercept this message in the main executable and then in
turn kill the sub process that i had spawned off.

here's it visually:

mainExe ---> spawnedProcess

if mainExe gets into bad state kill it

killExe ---TerminateProcess () ---> mainExe ---> spawnedProcess
* -- intercept
this message and kill spawned process before closing


aloha,
mike