public static bool SetAeroGlass(this Window Window, AeroMargin Margin) { if (!DwmIsCompositionEnabled()) return false; IntPtr hwnd = new WindowInteropHelper(Window).Handle; Window.Background = Brushes.Transparent; HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent; DwmExtendFrameIntoClientArea(hwnd, ref Margin); return true; }
static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref AeroMargin margins);