You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In previous version of the Windows App SDK, you used to be able to create a top-level window with a TransparentTintBackdrop and the DWM non-client rendering attribute to not use rounded corners on a window. This used to work on Windows App SDK versions 1.5.8 or earlier.
After upgrading to the latest version of the Windows App SDK (1.6.3 as of this writing), this has stopped working, and instead you get a thin border around the window, that I don't know how to remove. I have tried many different things, none of them have worked.
Is there any way to remove this thin border?
Steps to reproduce the bug
Here is some sample code:
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using System;
using Windows.Foundation;
using Windows.Win32.Foundation;
using Windows.Win32.Graphics.Dwm;
using WinUIEx;
using static Windows.Win32.PInvoke;
namespace MyApp;
internal sealed partial class MyWindow : Window
{
public readonly WindowManager Manager;
public MyWindow()
{
// Initialize the window.
InitializeComponent();
SystemBackdrop = new TransparentTintBackdrop();
Manager = WindowManager.Get(this);
Manager.PresenterKind = AppWindowPresenterKind.Overlapped;
Manager.MinWidth = 0;
Manager.MinHeight = 0;
Manager.IsAlwaysOnTop = false;
Manager.IsTitleBarVisible = false;
Manager.IsMaximizable = false;
Manager.IsMinimizable = false;
Manager.IsResizable = false;
var style = WindowStyle.TabStop | WindowStyle.Group | WindowStyle.ClipSiblings;
this.SetWindowStyle(style);
var exstyle = ExtendedWindowStyle.ToolWindow;
this.SetExtendedWindowStyle(exstyle);
// Disable rounded corners. This also has the effect of removing small thin border created
// around the window. The order in which this function is called is important.
unsafe
{
var hwnd = new HWND(WinRT.Interop.WindowNative.GetWindowHandle(this));
uint pref = (uint)DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND;
DwmSetWindowAttribute(hwnd, DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(uint));
}
// Show the window.
this.Show();
}
}
Expected behavior
It should be possible to create a window with no border, shadow effects, or anything else.
Screenshots
NuGet package version
Windows App SDK 1.6.3: 1.6.241114003
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
In previous version of the Windows App SDK, you used to be able to create a top-level window with a TransparentTintBackdrop and the DWM non-client rendering attribute to not use rounded corners on a window. This used to work on Windows App SDK versions 1.5.8 or earlier.
After upgrading to the latest version of the Windows App SDK (1.6.3 as of this writing), this has stopped working, and instead you get a thin border around the window, that I don't know how to remove. I have tried many different things, none of them have worked.
Is there any way to remove this thin border?
Steps to reproduce the bug
Here is some sample code:
Expected behavior
It should be possible to create a window with no border, shadow effects, or anything else.
Screenshots
NuGet package version
Windows App SDK 1.6.3: 1.6.241114003
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: