// Extends the aero glass frame into the client area of the given window. internal static bool ExtendGlassFrame(Window window, Thickness margins) { if (!CanExtendGlassFrame) return false; IntPtr hwnd = (new WindowInteropHelper(window)).Handle; Assumption.IsTrue(hwnd != IntPtr.Zero, "The window must be shown before extending glass."); window.Background = Brushes.Transparent; HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent; MARGINS m = new MARGINS(margins); DwmExtendFrameIntoClientArea(hwnd, ref m); return true; }
internal static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);