BetterExplorer.FolderSizeWindow.ExtendGlassFrame C# (CSharp) Метод

ExtendGlassFrame() приватный статический Метод

private static ExtendGlassFrame ( Window window, System.Windows.Thickness margin ) : bool
window System.Windows.Window
margin System.Windows.Thickness
Результат bool
        private static bool ExtendGlassFrame(Window window, Thickness margin)
        {
            if (!DwmIsCompositionEnabled())
                return false;

            IntPtr hwnd = new WindowInteropHelper(window).Handle;
            if (hwnd == IntPtr.Zero)
                throw new InvalidOperationException("The Window must be shown before extending glass.");

            // Set the background to transparent from both the WPF and Win32 perspectives
            window.Background = Brushes.Transparent;
            HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent;

            MARGINS margins = new MARGINS(margin);
            DwmExtendFrameIntoClientArea(hwnd, ref margins);
            return true;
        }