コード例 #1
0
ファイル: GlassHelper.cs プロジェクト: davidalmas/Samples
        public 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;
        }
コード例 #2
0
ファイル: GlassHelper.cs プロジェクト: davidalmas/Samples
 static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);
コード例 #3
0
 static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);