view plaincopy to clipboardPRint? [DllImport("User32.dll")] public static extern int GetCursorPos(out Point point); public static Point ScreenCursorPosition { get { Point showPoint = new Point(); GetCursorPos(out showPoint); return showPoint; } } [DllImport("User32.dll")] public static extern int GetCursorPos(out Point point); public static Point ScreenCursorPosition { get { Point showPoint = new Point(); GetCursorPos(out showPoint); return showPoint; } }
第二种 .Net 提供的最直接的属性
view plaincopy to clipboardprint? System.Windows.Forms.Cursor.Position