ZForge.Controls.HeaderPanelNativeMethods.GetWindowDC C# (CSharp) Метод

GetWindowDC() приватный Метод

private GetWindowDC ( IntPtr hWnd ) : IntPtr
hWnd System.IntPtr
Результат System.IntPtr
        public static extern IntPtr GetWindowDC(IntPtr hWnd);

Usage Example

Пример #1
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case WM_NCCALCSIZE:
                WmNCCalcSize(ref m);
                break;

            case WM_NCPAINT:
                IntPtr hDC = HeaderPanelNativeMethods.GetWindowDC(m.HWnd);
                if (hDC != IntPtr.Zero)
                {
                    using (Graphics canvas = Graphics.FromHdc(hDC))
                    {
                        PaintNonClientArea(canvas);
                    }
                    HeaderPanelNativeMethods.ReleaseDC(m.HWnd, hDC);
                }
                m.Result = IntPtr.Zero;
                break;
            }
            base.WndProc(ref m);
        }