From 2db3eee7b924c9bb0a3f2710781f973330c181b0 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 22 May 2020 08:49:39 -0300 Subject: [PATCH] add blurbehind api for someone to use for win7 support in future. --- .../Interop/UnmanagedMethods.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs b/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs index b06708ebd2..da52c3116e 100644 --- a/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs +++ b/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs @@ -1305,6 +1305,34 @@ namespace Avalonia.Win32.Interop [DllImport("dwmapi.dll")] public static extern int DwmIsCompositionEnabled(out bool enabled); + [DllImport("dwmapi.dll")] + public static extern void DwmEnableBlurBehindWindow(IntPtr hwnd, ref DWM_BLURBEHIND blurBehind); + + [Flags] + public enum DWM_BB + { + Enable = 1, + BlurRegion = 2, + TransitionMaximized = 4 + } + + [StructLayout(LayoutKind.Sequential)] + public struct DWM_BLURBEHIND + { + public DWM_BB dwFlags; + public bool fEnable; + public IntPtr hRgnBlur; + public bool fTransitionOnMaximized; + + public DWM_BLURBEHIND(bool enabled) + { + fEnable = enabled ? true : false; + hRgnBlur = IntPtr.Zero; + fTransitionOnMaximized = false; + dwFlags = DWM_BB.Enable; + } + } + [StructLayout(LayoutKind.Sequential)] internal struct RTL_OSVERSIONINFOEX {