diff --git a/Flow.Launcher.Infrastructure/CursorInfo.cs b/Flow.Launcher.Infrastructure/CursorInfo.cs
new file mode 100644
index 000000000..046dc4ba9
--- /dev/null
+++ b/Flow.Launcher.Infrastructure/CursorInfo.cs
@@ -0,0 +1,26 @@
+using System.Drawing;
+using System.Runtime.InteropServices;
+using Windows.Win32;
+
+namespace Flow.Launcher.Infrastructure;
+
+///
+/// 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
+{
+ public static Point Position
+ {
+ get
+ {
+ if (!PInvoke.GetCursorPos(out var pt))
+ {
+ Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
+ }
+ return pt;
+ }
+ }
+}
diff --git a/Flow.Launcher.Infrastructure/MonitorInfo.cs b/Flow.Launcher.Infrastructure/MonitorInfo.cs
index 9a62fc0f4..a87aab7d8 100644
--- a/Flow.Launcher.Infrastructure/MonitorInfo.cs
+++ b/Flow.Launcher.Infrastructure/MonitorInfo.cs
@@ -102,11 +102,7 @@ public class MonitorInfo
/// The display monitor that contains the cursor, or null if no monitor is found.
public static unsafe MonitorInfo GetCursorDisplayMonitor()
{
- if (!PInvoke.GetCursorPos(out var pt))
- {
- Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
- }
- var cursorMonitor = PInvoke.MonitorFromPoint(pt, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
+ var cursorMonitor = PInvoke.MonitorFromPoint(CursorInfo.Position, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
MonitorInfo cursorMonitorInfo = null;
var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) =>
{