Reputation: 434
I want to write a program in C# like Ghost-Mouse or auto-clicker. It will find the mouse location in windows and click there as i instructed. The question is, What code should I write to find specific mouse x and y locations and click globally. Can I get a sample code please? Thanks in advance.
Upvotes: 0
Views: 1067
Reputation: 17673
get position by
MousePosition.X
MousePosition.Y
example:
private void pictureBox1_Click(object sender, EventArgs e)
{
MessageBox.Show(string.Format("X: {0} Y: {1}", MousePosition.X, MousePosition.Y));
}
Upvotes: 1