Newsgroups: comp.windows.ms Path: utzoo!censor!geac!nixtor!davidm From: davidm@nixtor.uucp (David Macklem) Subject: Terminating another task under Win 3.0 Message-ID: Summary: how do I terminate another windows process? Keywords: kill, terminate Organization: Siemens Nixdorf Information Systems Ltd. Date: Sat, 20 Oct 90 15:23:57 GMT Lines: 30 I'm developing a Windows application that will need to kill another completely different Windows application and then restart it. The reason for this is that my application (AppA) is going to change the other application's (AppB) initialization files and AppB is going to need to re-initialize itself. I know how to restart AppB (just a WinExec call with the appropriate arguments) but I can't figure out how to kill AppB. I would have thought that it was something like this: /* Get a handle to AppB */ if (hAppB = GetModuleHandle("AppB")){ /* send AppB a QUIT message */ PostAppMessage(hAppB, WM_QUIT, NULL, NULL); /* wait for AppB to die */ while (GetModuleHandle("AppB") ; } Unfortunately, this does not work. (If the arguments to the above functions are slightly wrong, please forgive me but I'm typing in the code fragment from memory as the DOS machine is not beside me right now...) Thanks for any and all help. -- David Macklem Siemens Nixdorf Information Systems Ltd. davidm@nixtor 1131a Leslie Street, Toronto, Ontario uunet!mnetor!nixtor!davidm Canada M3C 3L8 (416-449-0035)