Example #1
0
        public static bool ExtendGlassFrame(Window AWindow, Thickness AThicknessMargin)
        {
            try
            {
                if (!DwmIsCompositionEnabled())
                {
                    return(false);
                }

                IntPtr LIntPtrHandle = new WindowInteropHelper(AWindow).Handle;
                if (LIntPtrHandle == IntPtr.Zero)
                {
                    return(false);
                }

                AWindow.Background = Brushes.Transparent;
                HwndSource.FromHwnd(LIntPtrHandle).CompositionTarget.BackgroundColor = Colors.Transparent;

                StructMargins LStructMargins = new StructMargins(AThicknessMargin);
                DwmExtendFrameIntoClientArea(LIntPtrHandle, ref LStructMargins);
            }
            catch { return(false); }

            return(true);
        }
Example #2
0
 static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref StructMargins pMarInset);