public static void ExtendAeroToFullWindow(Window wnd) { IntPtr hwnd = new WindowInteropHelper(wnd).Handle; wnd.Background = Brushes.Transparent; HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent; DWMMargins m = new DWMMargins(); m.top = -1; m.bottom = -1; m.left = -1; m.right = -1; DwmExtendFrameIntoClientArea(hwnd, ref m); }
private static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref DWMMargins margins);