基于WebView2实现的Win11桌面框架,利用插件自定义
Moli
2026-05-02 b4858d19fbad69810d211270bc5b280bf9909ea5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace Moli.Desktop.Tests.Interop;
 
public class Win32InteropContractTests
{
    [Fact]
    public void FakeInterop_CapturesWindowBehaviorForWindowTests()
    {
        var interop = new FakeWin32InteropService();
        var hwnd = new IntPtr(42);
 
        interop.SetClickThrough(hwnd, true);
        interop.SetToolWindow(hwnd, true);
        interop.SetNoActivate(hwnd, true);
        interop.SetLayered(hwnd, true, 128);
        interop.SetBottomMost(hwnd);
 
        Assert.True(interop.ClickThroughEnabled);
        Assert.True(interop.ToolWindowEnabled);
        Assert.True(interop.NoActivateEnabled);
        Assert.Equal(128, interop.Opacity);
        Assert.Single(interop.GetMonitors());
    }
}