Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

32 строки
706 B

  1. using System.Runtime.InteropServices;
  2. using System.Windows;
  3. namespace DamnOverSharp.Helpers
  4. {
  5. internal static class MouseHelper
  6. {
  7. [StructLayout(LayoutKind.Sequential)]
  8. public struct POINT
  9. {
  10. public int X;
  11. public int Y;
  12. public static implicit operator Point(POINT point)
  13. {
  14. return new Point(point.X, point.Y);
  15. }
  16. }
  17. [DllImport("user32.dll")]
  18. public static extern bool GetCursorPos(out POINT lpPoint);
  19. public static Point GetCursorPosition()
  20. {
  21. POINT lpPoint;
  22. GetCursorPos(out lpPoint);
  23. return lpPoint;
  24. }
  25. }
  26. }