private void button1_Click(object sender, EventArgs e) { if (_FFACE != null) { _FFACE = null; } if (t1 != null) { lock (threadLockObject) { t1.Abort(); t1 = null; } } //Changes the pol process. Does everything that above does, and a few more things to WindowerHelper selectedApp = comboBox1.SelectedIndex; Process[] pol = Process.GetProcessesByName("pol"); pID = pol[selectedApp].Id; if (pID != 0) { InitializeFFACE(); } else { MessageBox.Show("Error getting PID"); } }
private void InitializeFFACE() { try { _FFACE = new FFACETools.FFACE(pID); } catch (System.Exception ex) { MessageBox.Show("Error: Could not attach to process.\n" + ex.Message, "Error"); } finally { playername = _FFACE.Player.Name; notifyIcon1.Text = "Mob ID - " + playername; checkBox3.Checked = false; t1 = new Thread(new ThreadStart(GetTargetData)); t1.IsBackground = true; t1.Start(); } }