private void LockProcessButton_Click(object sender, EventArgs e) { if (OpenGLcheck.Checked == true && (ProcessListBox.SelectedIndex < 0 || ProcessListBox.SelectedIndex >= Process.GetProcessesByName("Medivia_OGL").Length)) { MessageBox.Show("Please choose client !"); return; } else if (DirectXcheck.Checked == true && (ProcessListBox.SelectedIndex < 0 || ProcessListBox.SelectedIndex >= Process.GetProcessesByName("Medivia_D3D").Length)) { MessageBox.Show("Please choose client !"); return; } else { if (OpenGLcheck.Checked == true) { proces = new MLProcessChecker(Process.GetProcessesByName("Medivia_OGL")[ProcessListBox.SelectedIndex]); } else if (DirectXcheck.Checked == true) { proces = new MLProcessChecker(Process.GetProcessesByName("Medivia_D3D")[ProcessListBox.SelectedIndex]); } SetWindowText(proces.cHWND, "Medivia " + proces.pid); this.Hide(); var MainWindow = new MLMainWindow(); MainWindow.InitializeClient(proces); MainWindow.Closed += (s, args) => this.Close(); MainWindow.Show(); } }
public void InitializeClient(MLProcessChecker klient) { this.klient = klient; }
public void InitializeClient(MLProcessChecker proces) { this.klient = proces; }