ZForge.Controls.HeaderPanelNativeMethods.ReleaseDC C# (CSharp) Method

ReleaseDC() private method

private ReleaseDC ( IntPtr hwnd, IntPtr hDC ) : int
hwnd System.IntPtr
hDC System.IntPtr
return int
        public static extern int ReleaseDC(IntPtr hwnd, IntPtr hDC);

Usage Example

Beispiel #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);
        }