基于WebView2实现的Win11桌面框架,利用插件自定义
Moli
2026-05-05 4df6165fa93c7caeea86385312415e312de4d11f
src/Moli.Desktop.Tests/Interop/Win32InteropContractTests.cs
@@ -1,3 +1,5 @@
using Moli.Desktop.Interop;
namespace Moli.Desktop.Tests.Interop;
public class Win32InteropContractTests
@@ -12,12 +14,16 @@
        interop.SetToolWindow(hwnd, true);
        interop.SetNoActivate(hwnd, true);
        interop.SetLayered(hwnd, true, 128);
        interop.MoveToDesktopLayer(hwnd, DesktopLayerMode.WorkerW, new Moli.Desktop.Layout.RectD(10, 20, 300, 120));
        interop.RestoreTopLevelWindow(hwnd);
        interop.SetBottomMost(hwnd);
        Assert.True(interop.ClickThroughEnabled);
        Assert.True(interop.ToolWindowEnabled);
        Assert.True(interop.NoActivateEnabled);
        Assert.Equal(128, interop.Opacity);
        Assert.Equal(new Moli.Desktop.Layout.RectD(10, 20, 300, 120), interop.LayerBounds);
        Assert.True(interop.RestoredTopLevel);
        Assert.Single(interop.GetMonitors());
    }
}