using System.Drawing; using System.Runtime.InteropServices; using Windows.Win32; namespace Flow.Launcher.Plugin.SharedModels; /// /// Contains full information about a cursor. /// /// /// Use this class to replace the System.Windows.Forms.Cursor class which can cause possible System.PlatformNotSupportedException. /// public class CursorInfo { /// /// Gets the current position of the cursor in screen coordinates. /// public static Point Position { get { if (!PInvoke.GetCursorPos(out var pt)) { Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); } return pt; } } }