Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaurasia14 committed Dec 20, 2023
1 parent 94f1c10 commit dffc205
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@
<Compile Include="System\Windows\WindowBackdropType.cs" />
<Compile Include="System\Windows\Interop\Dwapi.cs" />
<Compile Include="System\Windows\Interop\Libraries.cs" />
<Compile Include="System\Windows\Interop\UxTheme.cs" />
<Compile Include="System\Windows\Interop\UnsafeNativeMethodsWindow.cs" />
<Compile Include="System\Windows\Interop\UnsafeReflection.cs" />
<Compile Include="System\Windows\Annotations\AnchorInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ internal enum DWM_SIT
[DllImport(Libraries.Dwmapi, PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea(
[In] IntPtr hWnd,
[In] ref UxTheme.MARGINS pMarInset
[In] ref Standard.MARGINS pMarInset
);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,17 @@ public static bool RemoveWindowCaption(IntPtr hWnd)
return false;
}

var wtaOptions = new UxTheme.WTA_OPTIONS()
var wtaOptions = new WTA_OPTIONS()
{
dwFlags = UxTheme.WTNCA.NODRAWCAPTION,
dwMask = UxTheme.WTNCA.VALIDBITS
dwFlags = WTNCA.NODRAWCAPTION,
dwMask = WTNCA.VALIDBITS
};

UxTheme.SetWindowThemeAttribute(
NativeMethods.SetWindowThemeAttribute(
hWnd,
UxTheme.WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT,
WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT,
ref wtaOptions,
(uint)Marshal.SizeOf(typeof(UxTheme.WTA_OPTIONS))
(uint)Marshal.SizeOf(typeof(WTA_OPTIONS))
);

return true;
Expand Down Expand Up @@ -414,19 +414,18 @@ public static bool ExtendClientAreaIntoTitleBar(IntPtr hWnd)
}

// #1 Remove titlebar elements
var wtaOptions = new UxTheme.WTA_OPTIONS()
var wtaOptions = new WTA_OPTIONS()
{
dwFlags = (UxTheme.WTNCA.NODRAWCAPTION | UxTheme.WTNCA.NODRAWICON | UxTheme.WTNCA.NOSYSMENU),
dwMask = UxTheme.WTNCA.VALIDBITS
dwFlags = (WTNCA.NODRAWCAPTION | WTNCA.NODRAWICON | WTNCA.NOSYSMENU),
dwMask = WTNCA.VALIDBITS
};

Interop
.UxTheme
.SetWindowThemeAttribute(

NativeMethods.SetWindowThemeAttribute(
hWnd,
UxTheme.WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT,
WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT,
ref wtaOptions,
(uint)Marshal.SizeOf(typeof(UxTheme.WTA_OPTIONS))
(uint)Marshal.SizeOf(typeof(WTA_OPTIONS))
);

DisplayDpi windowDpi = DpiHelper.GetWindowDpi(hWnd);
Expand All @@ -438,7 +437,7 @@ public static bool ExtendClientAreaIntoTitleBar(IntPtr hWnd)
windowDpi.DpiScaleY
);

var dwmMargin = new UxTheme.MARGINS
var dwmMargin = new MARGINS
{
// err on the side of pushing in glass an extra pixel.
cxLeftWidth = (int)Math.Ceiling(deviceGlassThickness.Left),
Expand Down

This file was deleted.

0 comments on commit dffc205

Please sign in to comment.