----- Original Message ----- From: "Bill Tutt" <[EMAIL PROTECTED]> To: "'Mladen Turk'" <[EMAIL PROTECTED]>; <dev@apr.apache.org> Sent: Friday, February 15, 2002 11:44 PM Subject: RE: [PATCH] WIN32 Optimistic apr_proc_kill
> This isn't a nicer way to kill child processes. While DLL cleanup tasks > might happen you have no idea whether or not the app you're trying to > terminate is in a state useful to try this out. The user still might see > a Win32 generated A/V dialog (or worse) when you do try this trick. > We are calling kill, right? So If I launch APRized app (myself for example), then on exit the child will call the apr_terminate that will call the clenup for all the sub-child processes too! Got It? The killing of the child doesn't bother me, but that child might created some own child process. If I kill my own child the rest of them will kepp hanging. > How about this for an alternate suggestion: > 1) Posting a WM_CLOSE to its window(s) (if any). > You can do this by using a combination of EnumWindows, and > GetWindowThreadProcessID. > 2) If you don't find any windows try calling GenerateConsoleCtrlEvent > with CTRL_CLOSE_EVENT, and see if that causes the process to terminate. > If you know what you've lunched you can allways do that explicitly before calling apr_proc_kill. MT.