in reply to Killing a process on Windows (Win32::Process question)

In addition, you imply that kill might not totally remove a process, and you are correct. On Windows (like UNIX) another process can query the exit code (as BrowserUk mentioned) after the process has died. Therefore there is some residual resource (a couple of pages, I recall) kept while a process handle is open, even though is no longer appears in Task Manager. On UNIX we would call that a zombie, so make sure you close the process handle. Unlike UNIX, that process handle could be held by any other process, not just the parent.

In addition, also in the MSDN for TerminateProcess: The terminated process cannot exit until all pending I/O has been completed or canceled. This can be an issue with comms IO.

You also ask about 'subprocesses': Terminating a process does not cause child processes to be terminated.
  • Comment on Re: Killing a process on Windows (Win32::Process question)