基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-14 09d4e2f1a1bc206c80d8d3287d070c70ec7fd63d
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);