I am going to take a stab at this but I am not exactly sure, but you might try using the function TerminateProcess insead of CloseHandle. This will destroy the process and all of its threads.