1

I have big problem. In my code,

private void TestFunction()
{
   Process.Start("-other.program.exe");
}

and I want to the process kill when my main program is killed.

I can't use Closed event handler cause it'll not fire if my program is killed from task manager process list.

I found some keyword such as fork and exec, but I have not found how to do.

I want to kill the process which start by my program when my program is killed not right way.

Shaharyar
  • 12,254
  • 4
  • 46
  • 66
Won Hyoung Lee
  • 383
  • 2
  • 14

1 Answers1

0

Check out this answer given by Gonzalo.This way you can hook an action to the end of your programm. In there, you could kill your process by calling p.Close(); on the Process-object.

Community
  • 1
  • 1
  • It doesn't work. If i close my program by clicking close button, it work. But when I close my program by using **task manager**, it doesn't work. – Won Hyoung Lee Oct 11 '14 at 13:52