[Oobe]Fix close button style (#16530)

This commit is contained in:
Jaime Bernardo
2022-02-23 15:17:44 +00:00
committed by GitHub
parent d5fc4547a2
commit 50a73965d9
2 changed files with 5 additions and 5 deletions

View File

@@ -96,7 +96,7 @@ namespace PowerToys.Settings
{ {
base.OnSourceInitialized(e); base.OnSourceInitialized(e);
var hwnd = new WindowInteropHelper(this).Handle; var hwnd = new WindowInteropHelper(this).Handle;
NativeMethods.SetToolWindowStyle(hwnd); NativeMethods.SetPopupStyle(hwnd);
} }
} }
} }

View File

@@ -11,8 +11,8 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
{ {
public static class NativeMethods public static class NativeMethods
{ {
private const int GWL_EX_STYLE = -20; private const int GWL_STYLE = -16;
private const int WS_EX_TOOLWINDOW = 0x00000080; private const int WS_POPUP = 1 << 31; // 0x80000000
internal const int SPI_GETDESKWALLPAPER = 0x0073; internal const int SPI_GETDESKWALLPAPER = 0x0073;
[DllImport("user32.dll")] [DllImport("user32.dll")]
@@ -45,9 +45,9 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool SystemParametersInfo(int uiAction, int uiParam, StringBuilder pvParam, int fWinIni); internal static extern bool SystemParametersInfo(int uiAction, int uiParam, StringBuilder pvParam, int fWinIni);
public static void SetToolWindowStyle(IntPtr hwnd) public static void SetPopupStyle(IntPtr hwnd)
{ {
_ = SetWindowLong(hwnd, GWL_EX_STYLE, GetWindowLong(hwnd, GWL_EX_STYLE) | WS_EX_TOOLWINDOW); _ = SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) | WS_POPUP);
} }
} }
} }