Exemplo n.º 1
0
        public void InitializeShadows()
        {
            topShadowForm    = new FormGlowBorderElement(ShadowFormDockPositon.Top, parentWindowHWnd, this);
            leftShadowForm   = new FormGlowBorderElement(ShadowFormDockPositon.Left, parentWindowHWnd, this);
            bottomShadowForm = new FormGlowBorderElement(ShadowFormDockPositon.Bottom, parentWindowHWnd, this);
            rightShadowForm  = new FormGlowBorderElement(ShadowFormDockPositon.Right, parentWindowHWnd, this);

            shadows.Add(topShadowForm);
            shadows.Add(leftShadowForm);
            shadows.Add(bottomShadowForm);
            shadows.Add(rightShadowForm);

            User32.ShowWindow(topShadowForm.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(leftShadowForm.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(bottomShadowForm.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);
            User32.ShowWindow(rightShadowForm.Handle, ShowWindowStyles.SW_SHOWNOACTIVATE);


            isInitialized = true;

            AssignHandle(parentWindowHWnd);

            AlignSideShadowToTopMost();

            ActiveColor   = activeColor;
            InactiveColor = inactiveColor;
        }
Exemplo n.º 2
0
        //private void HandleSideMouseDown(object sender, ShadowFormResizeArgs e)
        //{
        //	if (e.Mode == HitTest.HTNOWHERE || e.Mode == HitTest.HTCAPTION)
        //	{
        //		return;
        //	}
        //	User32.PostMessage(parentWindowHWnd, (uint)WindowsMessages.WM_SETFOCUS, IntPtr.Zero, IntPtr.Zero);
        //	User32.SendMessage(parentWindowHWnd, (uint)WindowsMessages.WM_SYSCOMMAND, (IntPtr)e.Mode.ToInt(), IntPtr.Zero);
        //}

        private void CloseShadows()
        {
            foreach (var sideShadow in shadows)
            {
                sideShadow.Close();
            }

            shadows.Clear();

            topShadowForm    = null;
            bottomShadowForm = null;
            leftShadowForm   = null;
            rightShadowForm  = null;
        }