ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
psi.WindowStyle = ProcessWindowStyle.Hidden;
Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(MyExited);
p.StartInfo = psi;
p.Start();
..... do stuff ...
p.Kill(); // Try killing the process
private void MyExited(object sender, EventArgs e)
{
MessageBox.Show("Exited process");
}
This will run notepad "hidden" (for illustration purposes).. Then p.Kill();
should kill it.