mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[Oobe]Fix close button style (#16530)
This commit is contained in:
@@ -96,7 +96,7 @@ namespace PowerToys.Settings
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
NativeMethods.SetToolWindowStyle(hwnd);
|
||||
NativeMethods.SetPopupStyle(hwnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
public static class NativeMethods
|
||||
{
|
||||
private const int GWL_EX_STYLE = -20;
|
||||
private const int WS_EX_TOOLWINDOW = 0x00000080;
|
||||
private const int GWL_STYLE = -16;
|
||||
private const int WS_POPUP = 1 << 31; // 0x80000000
|
||||
internal const int SPI_GETDESKWALLPAPER = 0x0073;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@@ -45,9 +45,9 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user