/* Chiusura Form Mouse */ void frm_FormClosed(object sender, FormClosedEventArgs e) { if (frm != null) { try { /* Chiusura Processo Aperto in Corso */ Process[] pr = Process.GetProcessesByName(toolStripTextBox1.Text); for (int i = 0; i < pr.Length; i++) { pr[0].CloseMainWindow(); } } catch (Exception) { throw; } frm = null; } }
/* Recupera Coordinate X,Y del Click Mouse da ripetere */ private void BtnBookmark_Click(object sender, EventArgs e) { frm = new TestFormComponent(this); frm.FormClosed += new FormClosedEventHandler(frm_FormClosed); frm.Show(); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false; proc.StartInfo.FileName = toolStripTextBox1.Text; proc.StartInfo.Arguments = toolStripTextBox1.Text; if (toolStripTextBox1.Text != "") { proc.Start(); } else { proc.Dispose(); } }