ProcessStartInfo psi; Process p; string prcpath = @"D:\Myproject\testhelp.chm"; private void mnuOnScreen_Click(object sender, EventArgs e) { psi = new ProcessStartInfo(prcpath); p = Process.Start(psi); MessageBox.Show("New process created"); } //code for close process private void FrmTRMS_FormClosing(object sender, FormClosingEventArgs e) { try { if (p.HasExited) { p.CloseMainWindow(); } else { p.Kill(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)