同标题,
在网上找到了一个可以在webbrowser上取得鼠标的坐标的代码。但是使用之后发现程序执行后代码取得的坐标每次都不一样?
附代码
引用
using System.Runtime.InteropServices;
定义
[DllImport("user32.dll")]
static extern bool GetCursorPos(ref Point lpPoint);
调用
Point p = new Point();
GetCursorPos(ref p);
this.label1.Text = "X=" + p.X.ToString() + "    Y=" + p.Y.ToString();每次都不一样 并且取得不到0坐标
套用小沈阳的一句话:这是为什么呢?