예제 #1
0
파일: WindowUtil.cs 프로젝트: kingpin2k/MCS
 private static bool SetGlassMargin(this Window window, Thickness margin)
 {
     if (!NativeMethods.DwmIsCompositionEnabled())
         return false;
     IntPtr handle = new WindowInteropHelper(window).Handle;
     if (handle == IntPtr.Zero)
         throw new InvalidOperationException("The Window must be loaded before extending glass.");
     window.Background = (Brush)Brushes.Transparent;
     HwndSource.FromHwnd(handle).CompositionTarget.BackgroundColor = Colors.Transparent;
     MARGINS margins = new MARGINS(margin);
     NativeMethods.DwmExtendFrameIntoClientArea(handle, ref margins);
     return true;
 }
예제 #2
0
 public static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);