Esempio n. 1
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case 132:
                base.WndProc(ref m);
                if ((int)m.Result != 1)
                {
                    return;
                }
                if (this.skeetResizable)
                {
                    Point client = this.PointToClient(new Point(m.LParam.ToInt32()));
                    if (client.Y <= 10)
                    {
                        if (client.X <= 10)
                        {
                            m.Result = (IntPtr)13;
                            return;
                        }
                        if (client.X < this.Size.Width - 10)
                        {
                            m.Result = (IntPtr)12;
                            return;
                        }
                        m.Result = (IntPtr)14;
                        return;
                    }
                    int  y    = client.Y;
                    Size size = this.Size;
                    int  num1 = size.Height - 10;
                    if (y <= num1)
                    {
                        if (client.X <= 10)
                        {
                            m.Result = (IntPtr)10;
                            return;
                        }
                        int x = client.X;
                        size = this.Size;
                        int num2 = size.Width - 10;
                        if (x < num2)
                        {
                            m.Result = (IntPtr)2;
                            return;
                        }
                        m.Result = (IntPtr)11;
                        return;
                    }
                    if (client.X <= 10)
                    {
                        m.Result = (IntPtr)16;
                        return;
                    }
                    int x1 = client.X;
                    size = this.Size;
                    int num3 = size.Width - 10;
                    if (x1 < num3)
                    {
                        m.Result = (IntPtr)15;
                        return;
                    }
                    m.Result = (IntPtr)17;
                    return;
                }
                m.Result = (IntPtr)2;
                return;

            case 133:
                if (this.m_aeroEnabled)
                {
                    int attrValue = 2;
                    skeetForm.DwmSetWindowAttribute(this.Handle, 2, ref attrValue, 4);
                    skeetForm.MARGINS pMarInset = new skeetForm.MARGINS()
                    {
                        bottomHeight = 1,
                        leftWidth    = 0,
                        rightWidth   = 0,
                        topHeight    = 0
                    };
                    skeetForm.DwmExtendFrameIntoClientArea(this.Handle, ref pMarInset);
                    break;
                }
                break;
            }
            if (m.Msg == 163)
            {
                m.Result = IntPtr.Zero;
            }
            else
            {
                base.WndProc(ref m);
                if (m.Msg != 132 || (int)m.Result != 1)
                {
                    return;
                }
                m.Result = (IntPtr)2;
            }
        }
Esempio n. 2
0
 public static extern int DwmExtendFrameIntoClientArea(
     IntPtr hWnd,
     ref skeetForm.MARGINS pMarInset);