private void Panel2_Click(object sender, EventArgs e) { PidSelect pidSelect = new PidSelect(); pidSelect.GetPid += (PidSelect.PidSelector)(x => { this.kc.isBackGroundKey = true; this.kc.InitBackGroundKey(Process.GetProcessById(x).MainWindowHandle); }); pidSelect.ShowDialog(); }
private void BtnTimeSync_Click(object sender, EventArgs e) { if (isCaptureFlag) { net._shouldStop = true; isCaptureFlag = false; (sender as Button).Text = "网络同步"; (sender as Button).BackColor = Color.FromArgb(255, 110, 128); } else { TimeSync(); net = new NetworkClass(); net.Play += Net_Play; try { List <Process> ffxivProcess = FFProcess.FindFFXIVProcess(); if (ffxivProcess.Count == 1) { Task.Run((Action)(() => this.net.Run((uint)FFProcess.FindFFXIVProcess().First <Process>().Id))); this.isCaptureFlag = true; (sender as Button).Text = "停止同步"; (sender as Button).BackColor = Color.Aquamarine; } else if (ffxivProcess.Count >= 2) { uint id = 0; PidSelect pidSelect = new PidSelect(); pidSelect.GetPid += (PidSelect.PidSelector)(x => id = (uint)x); int num = (int)pidSelect.ShowDialog(); Task.Run((Action)(() => this.net.Run(id))); this.isCaptureFlag = true; (sender as Button).Text = "停止同步"; (sender as Button).BackColor = Color.Aquamarine; } else { MessageBox.Show(new Form() { TopMost = true }, "你开游戏了吗?", "喵喵喵?", MessageBoxButtons.OK, MessageBoxIcon.Question); } } catch (Exception exception) { } } }