private void MainMenuSpyAttach_Click(object sender, EventArgs e) { if (Worker.IsBusy) { return; } if (m_Spy == null) { m_Spy = new Spy(); } SelectProcess select = new SelectProcess(); if (select.ShowDialog() == DialogResult.OK) { Process process = select.GetSelectedProcess(); if (process != null) { MainMenuSpyStart.Enabled = false; MainMenuSpyAttach.Enabled = false; MainMenuSpyDetach.Enabled = true; StatusLabel.Text = String.Format("Spying on {0}", process.ProcessName); Worker.RunWorkerAsync(new SpyProcessArgs(process)); } } }
private void MainMenuSpyAttach_Click( object sender, EventArgs e ) { if ( Worker.IsBusy ) return; if ( m_Spy == null ) m_Spy = new Spy(); SelectProcess select = new SelectProcess(); if ( select.ShowDialog() == DialogResult.OK ) { Process process = select.GetSelectedProcess(); if ( process != null ) { MainMenuSpyStart.Enabled = false; MainMenuSpyAttach.Enabled = false; MainMenuSpyDetach.Enabled = true; StatusLabel.Text = String.Format( "Spying on {0}", process.ProcessName ); Worker.RunWorkerAsync( new SpyProcessArgs( process ) ); } } }