private void Form1_Load(object sender, EventArgs e) { Process[] p = Process.GetProcessesByName("APPLICATION"); foreach (Process proc in p) { nsComboBox1.Items.Add(proc.Id); } } private void nsButton1_Click(object sender, EventArgs e) { nsComboBox1.Items.Clear(); Process[] p = Process.GetProcessesByName("APPLICATION"); foreach (Process proc in p) { nsComboBox1.Items.Add(proc.Id); } } private void nsButton2_Click(object sender, EventArgs e) { int PID = Int32.Parse(nsComboBox1.SelectedItem.ToString()); using (var memory = new MemorySharp(Process.GetProcessById(PID))) { memory.Windows.MainWindow.Mouse.MoveTo(189, 636); memory.Windows.MainWindow.Mouse.DoubleClickLeft(); } }
So I'm trying to send MouseClicks & KeyStrokes to a specific application, I want to be able to have 2-3 of that application running, and 2-3 of the application I'm trying to make.
Then I'd choose which PID I want each one to "attach" to and hit a Start Button which would then start sending these MouseClicks and KeyStrokes to that specific application and at a certain point start over/loop, while also still allowing the same to happen with the other 2-3.
The issue is, I can get the PID, and I can send the Clicks and Keys, however it requires the window to be in focus which prevents me from being able to send it to multiple applications, or use my computer for anything else while it runs.
Any and all help is greatly appreciated, I'm really new to this type of thing and looking to learn.