private void scanBtn_Click(object sender, EventArgs e) { if ((comboBoxProcesses.SelectedIndex.ToString()).CompareTo("-1") != 0) { var pidNumber = ((ComboboxItem)comboBoxProcesses.SelectedItem).Value; Process myProcess; try { myProcess = Process.GetProcessById(pidNumber); } catch { MessageBox.Show("The selected process no longer exists.\nPlease choose another one.", "Memory Scraper", MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshProcessList(); return; } if(isThisSpecialProgram(myProcess.ProcessName)) { pidNumber = myProcess.Parent().Id; var scrapPage = new ScrapingPage(pidNumber, false); scrapPage.Show(); } else { var procs = Process.GetProcessesByName(myProcess.ProcessName); if (procs.Count() > 1) { var multi = new MultiThreadSearch(myProcess.ProcessName); multi.Show(); } else { var scrapPage = new ScrapingPage(pidNumber, false); scrapPage.Show(); } } Hide(); } else { MessageBox.Show("The selected process is not on the list.\nPlease choose another one.", "Memory Scraper", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void scanBtn_Click(object sender, EventArgs e) { if ((comboBoxProcesses.SelectedIndex.ToString()).CompareTo("-1") != 0) { var pidNumber = ((ComboboxItem)comboBoxProcesses.SelectedItem).Value; Process myProcess; try { myProcess = Process.GetProcessById(pidNumber); } catch { MessageBox.Show("The selected process no longer exists.\nPlease choose another one.", "Memory Scraper", MessageBoxButtons.OK, MessageBoxIcon.Information); RefreshProcessList(); return; } if (isThisSpecialProgram(myProcess.ProcessName)) { pidNumber = myProcess.Parent().Id; var scrapPage = new ScrapingPage(pidNumber, false); scrapPage.Show(); } else { var procs = Process.GetProcessesByName(myProcess.ProcessName); if (procs.Count() > 1) { var multi = new MultiThreadSearch(myProcess.ProcessName); multi.Show(); } else { var scrapPage = new ScrapingPage(pidNumber, false); scrapPage.Show(); } } Hide(); } else { MessageBox.Show("The selected process is not on the list.\nPlease choose another one.", "Memory Scraper", MessageBoxButtons.OK, MessageBoxIcon.Information); } }