Get the Cursor Position

using System.Runtime.InteropServices;

[DllImport("user32.dll")]
static extern bool GetCursorPos(ref Point lpPoint);

Point defPnt = new Point();
GetCursorPos(ref defPnt);

string CoordinatesXnY  = "X = " + defPnt.X.ToString() + "Y = " + defPnt.Y.ToString();

Comments

Popular posts from this blog

Convert XElement to DataTable

Enable mouse scroll-wheel in VB6

C# code to Check IE Proxy Settings