Exemple #1
0
        /// <summary>
        /// Sets the shadow effect up.
        /// </summary>
        public override void Setup()
        {
            //Extend the frame into the client area on the bottom by 1 pixel so we get our nice, bold shadow effect.
            int val = 2;

            NativeMethods.DwmSetWindowAttribute(this.TargetForm.Handle, 2, ref val, 4);
            var margins = new NativeStructs.MARGINS(0, 0, 0, 1);

            NativeMethods.DwmExtendFrameIntoClientArea(this.TargetForm.Handle, ref margins);
        }
Exemple #2
0
        protected override void WndProc(ref Message m)
        {
            if (aero && DropShadowEnable && (m.Msg == NativeConstants.WM_NCPAINT))
            {
                int attr = 2;
                NativeMethods.DwmSetWindowAttribute(this.Handle, NativeEnums.DWMWINDOWATTRIBUTE.NCRenderingPolicy, ref attr, 4);

                var margin = new NativeStructs.MARGINS
                {
                    bottomHeight = Deapth,
                    leftWidth    = Deapth,
                    rightWidth   = Deapth,
                    topHeight    = Deapth
                };

                NativeMethods.DwmExtendFrameIntoClientArea(this.Handle, ref margin);
            }

            base.WndProc(ref m);
        }