Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用 C# 编写一个程序,比如 Ghost-Mouse 或自动点击器。它会在窗口中找到鼠标位置,然后按照我的指示单击那里。问题是,我应该编写什么代码来查找特定的鼠标 x 和 y 位置并全局单击。请问我可以得到一个示例代码吗?提前致谢。
获得位置
MousePosition.X MousePosition.Y
例子:
private void pictureBox1_Click(object sender, EventArgs e) { MessageBox.Show(string.Format("X: {0} Y: {1}", MousePosition.X, MousePosition.Y)); }