From fb53e19cededbd78158231ae4aed8ca0f0a92ed4 Mon Sep 17 00:00:00 2001 From: Renn <8340896+AkazaRenn@users.noreply.github.com> Date: Wed, 24 Dec 2025 22:06:54 -0500 Subject: [PATCH] Fix ToggleWindowStyle not working on visible = true --- src/WinUIEx/HwndExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WinUIEx/HwndExtensions.cs b/src/WinUIEx/HwndExtensions.cs index 44bd44a..9c987a4 100644 --- a/src/WinUIEx/HwndExtensions.cs +++ b/src/WinUIEx/HwndExtensions.cs @@ -238,7 +238,7 @@ public static void ToggleWindowStyle(IntPtr hWnd, bool visible, WindowStyle styl var currentStyle = PInvoke.GetWindowLong(h, WINDOW_LONG_PTR_INDEX.GWL_STYLE); var newStyle = currentStyle; if (visible) - newStyle = (newStyle & (int)style); + newStyle = (newStyle | (int)style); else newStyle = (newStyle & ~(int)style); var r = PInvoke.SetWindowLong(h, WINDOW_LONG_PTR_INDEX.GWL_STYLE, newStyle);