You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
771 B
C#
32 lines
771 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
|
|
namespace NodeEditor.Extensions
|
|
{
|
|
class MouseExtensions
|
|
{
|
|
[DllImport("user32.dll")]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
internal static extern bool GetCursorPos(ref Win32Point pt);
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
internal struct Win32Point
|
|
{
|
|
public Int32 X;
|
|
public Int32 Y;
|
|
};
|
|
public static Point GetMousePosition()
|
|
{
|
|
var w32Mouse = new Win32Point();
|
|
GetCursorPos(ref w32Mouse);
|
|
|
|
return new Point(w32Mouse.X, w32Mouse.Y);
|
|
}
|
|
}
|
|
}
|