protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); ExtendGlass.ExtendDwmGlass(this, new Thickness(-1)); //WindowExtensions.SystemMenu(this); HwndSource.FromHwnd(new WindowInteropHelper(this).Handle).AddHook(new HwndSourceHook(WindowExtensions.GlassWndProc)); }
public static IntPtr GlassWndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == ExtendGlass.WM_DWMCOMPOSITIONCHANGED) { ExtendGlass.ExtendDwmGlass(_form, new Thickness(-1)); handled = true; } return(IntPtr.Zero); }