private void RAL_Tick(object sender, EventArgs e) { RAL.Stop(); foreach (Process Process in Process.GetProcesses().Where(p => !string.IsNullOrEmpty(p.MainWindowTitle) && Text != p.MainWindowTitle).ToList()) { if (LProcs.ContainsKey(Process.ProcessName)) { if (BPProcs.ContainsKey(Process.ProcessName) && !BPProcs[Process.ProcessName] && PProcs.ContainsKey(Process.ProcessName) && PProcs[Process.ProcessName]) { PProcs[Process.ProcessName] = false; MBProcs[Process.ProcessName] = true; AppPassword AP = new AppPassword(Process.ProcessName, Procs[Process.ProcessName], AppPassword.Type.G); AP.Show(); } } else { LProcs[Process.ProcessName] = Process.ProcessName; panel1.Controls.Add(new RunApp(null, Process.ProcessName, Process.MainWindowTitle, Process.StartInfo.WorkingDirectory) { Dock = DockStyle.Top }); } } RAL.Start(); }
private void startRAL() { updateStatus("Initialising RAL...."); List<String> executables = new List<string>(); findExe(ref executables); while (isRunning){ RAL ral = new RAL(executables[rand.Next(0, executables.Count)], this); System.Threading.Thread t = new System.Threading.Thread(ral.launch); t.IsBackground = true; t.Start(); System.Threading.Thread.Sleep(10000); updateStatus("Running...."); } updateStatus("RAL Halted."); }