示例#1
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case All.Class.Api.WM_PAINT:
                if (!drawing)
                {
                    All.Class.Api.PAINTSTRUCT ps = new All.Class.Api.PAINTSTRUCT();

                    drawing = true;
                    All.Class.Api.BeginPaint(m.HWnd, ref ps);
                    this.PaintBack();
                    using (Graphics g = Graphics.FromHwnd(m.HWnd))
                    {
                        g.DrawImageUnscaled(backImage, 0, 0);
                    }
                    All.Class.Api.EndPaint(m.HWnd, ref ps);
                    drawing  = false;
                    m.Result = All.Class.Api.True;
                }
                else
                {
                    base.WndProc(ref m);
                }
                break;

            default:
                base.WndProc(ref m);
                break;
            }
        }
示例#2
0
        protected override void WndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {
            case All.Class.Api.WM_PAINT:
            case All.Class.Api.WM_CTLCOLOREDIT:
                if (!drawing)
                {
                    drawing = true;
                    All.Class.Api.PAINTSTRUCT ps = new All.Class.Api.PAINTSTRUCT();
                    All.Class.Api.BeginPaint(m.HWnd, ref ps);
                    this.WmPaint(ref m);
                    All.Class.Api.EndPaint(m.HWnd, ref ps);
                    m.Result = All.Class.Api.True;
                    drawing  = false;
                }
                else
                {
                    base.WndProc(ref m);
                }
                break;

            default:
                base.WndProc(ref m);
                break;
            }
        }