コード例 #1
0
ファイル: YForm.cs プロジェクト: karifa/moo-plus
 public extern static int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref StructBorder strtborder);
コード例 #2
0
ファイル: YForm.cs プロジェクト: NithinKharvi/moo-plus
 public static extern int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref StructBorder strtborder);
コード例 #3
0
ファイル: YForm.cs プロジェクト: karifa/moo-plus
        private void SetupBorders()
        {
            if (System.Environment.OSVersion.Version.Major >= 6)  //make sure you are not on a legacy OS
            {
                int          IsXFrameEble = 0;
                StructBorder strtborder   = new StructBorder();

                //check if the desktop composition is enabled
                DwmIsCompositionEnabled(ref IsXFrameEble);
                if (IsXFrameEble > 0)
                {
                    //left conner
                    if (this.border.Left > 0)
                    {
                        this.PbxLeft.Visible = true;
                        this.PbxLeft.Width   = this.border.Left;
                        strtborder.Left      = this.border.Left;
                    }
                    else
                    {
                        this.PbxLeft.Visible = false;
                        this.PbxLeft.Height  = 0;
                        strtborder.Left      = 0;
                    }
                    //top corner
                    if (this.border.Top > 0)
                    {
                        this.PbxTop.Visible = true;
                        this.PbxTop.Height  = this.border.Top;
                        strtborder.Top      = this.border.Top;
                    }
                    else
                    {
                        this.PbxTop.Visible = false;
                        this.PbxTop.Height  = 0;
                        strtborder.Top      = 0;
                    }

                    //right corner
                    if (this.border.Right > 0)
                    {
                        this.PbxRight.Visible = true;
                        this.PbxRight.Width   = this.border.Right;
                        strtborder.Right      = this.border.Right;
                    }
                    else
                    {
                        this.PbxRight.Visible = false;
                        this.PbxRight.Height  = 0;
                        strtborder.Right      = 0;
                    }
                    //bottom corner
                    if (this.border.Bottom > 0)
                    {
                        this.PbxBottom.Visible = true;
                        this.PbxBottom.Height  = this.border.Bottom;
                        strtborder.Bottom      = this.border.Bottom;
                    }
                    else
                    {
                        this.PbxBottom.Visible = false;
                        this.PbxBottom.Height  = 0;
                        strtborder.Bottom      = 0;
                    }

                    DwmExtendFrameIntoClientArea(this.Handle, ref strtborder);
                }
            }
        }
コード例 #4
0
ファイル: YForm.cs プロジェクト: NithinKharvi/moo-plus
        private void SetupBorders()
        {
            if (System.Environment.OSVersion.Version.Major >= 6)  //make sure you are not on a legacy OS
            {
                int IsXFrameEble = 0;
                StructBorder strtborder = new StructBorder();

                //check if the desktop composition is enabled
                DwmIsCompositionEnabled(ref IsXFrameEble);
                if (IsXFrameEble > 0)
                {
                    //left conner
                    if (this.border.Left > 0)
                    {
                        this.PbxLeft.Visible = true;
                        this.PbxLeft.Width = this.border.Left;
                        strtborder.Left = this.border.Left;
                    }
                    else {
                        this.PbxLeft.Visible = false;
                        this.PbxLeft.Height = 0;
                        strtborder.Left = 0;
                    }
                    //top corner
                    if (this.border.Top > 0)
                    {
                        this.PbxTop.Visible = true;
                        this.PbxTop.Height = this.border.Top;
                        strtborder.Top = this.border.Top;
                    }
                    else
                    {
                        this.PbxTop.Visible = false;
                        this.PbxTop.Height = 0;
                        strtborder.Top = 0;
                    }

                    //right corner
                    if (this.border.Right > 0)
                    {
                        this.PbxRight.Visible = true;
                        this.PbxRight.Width = this.border.Right;
                        strtborder.Right = this.border.Right;
                    }
                    else
                    {
                        this.PbxRight.Visible = false;
                        this.PbxRight.Height = 0;
                        strtborder.Right = 0;
                    }
                    //bottom corner
                    if (this.border.Bottom > 0)
                    {
                        this.PbxBottom.Visible = true;
                        this.PbxBottom.Height = this.border.Bottom;
                        strtborder.Bottom = this.border.Bottom;
                    }
                    else
                    {
                        this.PbxBottom.Visible = false;
                        this.PbxBottom.Height = 0;
                        strtborder.Bottom = 0;
                    }

                    DwmExtendFrameIntoClientArea(this.Handle, ref strtborder);
                }
            }
        }