From b84db8983d63a9a981083ebce1a139860c6bdf25 Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期五, 14 八月 2026 15:35:21 +0800
Subject: [PATCH] commit

---
 src/Moli.Desktop/Interop/NativeMethods.cs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/Moli.Desktop/Interop/NativeMethods.cs b/src/Moli.Desktop/Interop/NativeMethods.cs
index d3fa8d1..9bc2ea8 100644
--- a/src/Moli.Desktop/Interop/NativeMethods.cs
+++ b/src/Moli.Desktop/Interop/NativeMethods.cs
@@ -25,7 +25,9 @@
     internal const int WmDisplayChange = 0x007E;
     internal const int WmSettingChange = 0x001A;
     internal const int WmDeviceChange = 0x0219;
+    internal const int WmHotkey = 0x0312;
     internal const int MdtEffectiveDpi = 0;
+    internal const int ErrorHotkeyAlreadyRegistered = 1409;
     internal static readonly IntPtr HwndBottom = new(1);
     internal static readonly IntPtr HwndMessage = new(-3);
 
@@ -79,6 +81,14 @@
     [return: MarshalAs(UnmanagedType.Bool)]
     internal static extern bool GetWindowRect(IntPtr hWnd, out Rect lpRect);
 
+    [DllImport("user32.dll", SetLastError = true)]
+    [return: MarshalAs(UnmanagedType.Bool)]
+    internal static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
+
+    [DllImport("user32.dll", SetLastError = true)]
+    [return: MarshalAs(UnmanagedType.Bool)]
+    internal static extern bool UnregisterHotKey(IntPtr hWnd, int id);
+
     [DllImport("user32.dll", SetLastError = false)]
     [return: MarshalAs(UnmanagedType.Bool)]
     internal static extern bool IsWindow(IntPtr hWnd);

--
Gitblit v1.9.1