日期:2014-05-19  浏览次数:20750 次

如何调用GetCursorPos这个API函数?
RT

------解决方案--------------------
获取鼠标位置 加上对该函数的引用[dllImport ....]
------解决方案--------------------
如果是C#没必要调API吧,直接用Cursor.Position.X和Cursor.Position.Y就可以得到鼠标在屏幕上的坐标
------解决方案--------------------
System.Windows.Forms.Cursor.Position.GetType() == typeof(System.Drawing.Point) is true
------解决方案--------------------
[DllImport( "user32.dll ")]
static extern bool GetCursorPos(out Point lpPoint);

Alternative Managed API:

System.Windows.Forms.Cursor.Position