private void ClickSendMSGButton_Click(object sender, EventArgs e) { if (!GetWindow()) { return; } var x = 100; var y = 100; var amount = 1; if (ClickXCoord.Text.Length > 0) { x = int.Parse(ClickXCoord.Text); } if (ClickYCoord.Text.Length > 0) { y = int.Parse(ClickYCoord.Text); } if (ClickAmount.Text.Length > 0) { amount = int.Parse(ClickAmount.Text); } Clicks.ClickUsingSend(ControlHandle != (IntPtr)0x0 ? ControlHandle : WindowHandle, x, y, amount); }