> From: Mladen Turk [mailto:[EMAIL PROTECTED] > > My primary intention was to kill the entire process tree. (I'll try to do > that using PSAPI and VDMDBG). >
Err, Win32 doesn't have a process tree. Win32 only has process groups. (See CreateProcess and CREATE_NEW_PROCESS_GROUP.) GenerateConsoleCtrlEvent sends the specified "signal" to the entire process group. Sending a WM_CLOSE to your child process's window (if any) is the appropriate mechanism for cleanly killing a process with a window. If your child is a GUI app the world is well. If your child is a console application your WM_CLOSE message should translate into a GenerateConsoleCtrlEvent for the earliest process associated with that console window. Knowledge base article Q178893 has more information on what you have to do in this area of cleanly terminating applications. Additionally, I don't think calling the NT VDM functions is going to do you much good at the moment because APR process creation doesn't really handle successfully creating 16 bit child processes well at all. If I were you I'd never suggest adding support for that. Instead encourage folks to write more 32 bit console applications. There's no need to go and create more reasons for why the NT VDM needs to stick around. That stuff is just plain evil. *mutters about 16 bit setup binaries hanging until you reboot your computer* Always glad to help out, Bill