title: Terminate a process tree (C for Windows)
body: <p>This has been asked before but I can't find a definitive answer, in code.</p>
  
  <p>I open a process, ProcessA (with PID 1234). This process opens a child process, ProcessAB (PID 5678).
  After I'm done I terminate ProcessA but I still have the lingering of ProcessAB.</p>
  
  <p>How do I terminate the whole process tree? What I mean, how do I make sure that if I terminate the process I opened I am also terminating all the associated processes?</p>
  
  <p>Thanks</p>
  
  <p>Code is appreciated.</p>