private void ControlRemoteProcessToolStripMenuItem_Click(object sender, EventArgs e) { if (!remoteProcess.IsValid) { return; } var action = NativeHelper.ControlRemoteProcessAction.Terminate; if (sender == resumeProcessToolStripMenuItem) { action = NativeHelper.ControlRemoteProcessAction.Resume; } else if (sender == suspendProcessToolStripMenuItem) { action = NativeHelper.ControlRemoteProcessAction.Suspend; } nativeHelper.ControlRemoteProcess(remoteProcess.Process.Handle, action); }