private void EnsureExtended() { // We completely ignore anything for extending client area in Avalonia Window impl b/c // we're doing super specialized stuff to ensure the best experience interacting with // the window and mimic-ing a "modern app" var marg = new Win32Interop.MARGINS(); // WS_OVERLAPPEDWINDOW // 0x00C00000L 0x00080000L 不需要标题栏 // 0x00040000L 创建一个具有粗框的窗口可以用来调整窗口的大小 var style = 0x00000000L | 0X00800000L | 0x00020000L | 0x00010000L; // This is causing the window to appear solid but is completely transparent. Weird... //Win32Interop.GetWindowLongPtr(Hwnd, -16).ToInt32(); RECT frame = new RECT(); Win32Interop.AdjustWindowRectExForDpi(ref frame, (int)style, false, 0, (int)(RenderScaling * 96)); marg.topHeight = -frame.top + (_isWindows11 ? 0 : -1); Win32Interop.DwmExtendFrameIntoClientArea(Handle.Handle, ref marg); }