internal static void ExtendFrameIntoClientArea(IntPtr hwnd, ref WinApi.Margins margins) { if (isSupported) { WinApi.DwmExtendFrameIntoClientArea(hwnd, ref margins); } }
private void SetGlass() { IsCompositionEnabled = DesktopWindowManager.IsCompositionEnabled; if (ParentWindow != null) { if (IsCompositionEnabled) { orinalWindowBackground = ParentWindow.Background; ParentWindow.Background = Brushes.Transparent; HwndSource.CompositionTarget.BackgroundColor = Colors.Transparent; Matrix dpiMatrix = HwndSource.CompositionTarget.TransformToDevice; double dpiY = dpiMatrix.M22; // Create a margin structure var margins = new WinApi.Margins { Left = 0, Right = 0, Top = (int)Math.Round(this.ActualHeight * dpiY, MidpointRounding.AwayFromZero), Bottom = 0 }; DesktopWindowManager.ExtendFrameIntoClientArea(HwndSource.Handle, ref margins); } DesktopWindowManager.SetTitleAndIconVisibility(HwndSource.Handle, false); } }
internal static void ResetGlass(IntPtr hwnd) { if (isSupported) { var margins = new WinApi.Margins(false); WinApi.DwmExtendFrameIntoClientArea(hwnd, ref margins); } }
internal static void ResetGlass(IntPtr hwnd) { if (isSupported) { var margins = new WinApi.Margins(false); WinApi.DwmExtendFrameIntoClientArea(hwnd, ref margins); } }
private void SetGlass() { IsCompositionEnabled = DesktopWindowManager.IsCompositionEnabled; if (ParentWindow != null) { if (IsCompositionEnabled) { orinalWindowBackground = ParentWindow.Background; ParentWindow.Background = Brushes.Transparent; HwndSource.CompositionTarget.BackgroundColor = Colors.Transparent; Matrix dpiMatrix = HwndSource.CompositionTarget.TransformToDevice; double dpiY = dpiMatrix.M22; // Create a margin structure var margins = new WinApi.Margins { Left = 0, Right = 0, Top = (int)Math.Round(this.ActualHeight * dpiY, MidpointRounding.AwayFromZero), Bottom = 0 }; DesktopWindowManager.ExtendFrameIntoClientArea(HwndSource.Handle, ref margins); } DesktopWindowManager.SetTitleAndIconVisibility(HwndSource.Handle, false); } }