I am creating several process using code bellow,and I want to kill them all when their parent dies.
Process p = new Process();
p.StartInfo.FileName = @"G:\test.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = false;
p.Start();
1- I searched to much but cant found a solution. the only usefull solution is :
but I have an error on this line Win32.CloseHandle(m_handle);
2- I am using .netframework 3.5 and I cant use tasks.
3- I used p.WaitForExit();
but my mainform freezed .
Is there any way to kill processes on parent dies without freezing the form ?