Beispiel #1
0
        public static IntPtr GetDC(HandleRef hWnd)
        {
            IntPtr hDc = IntGetDC(hWnd);

            if (hDc == IntPtr.Zero)
            {
                throw new Win32Exception();
            }

            return(HandleCollector.Add(hDc, NativeMethods.CommonHandles.HDC));
        }
Beispiel #2
0
 public static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
 {
     HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC);
     return(IntReleaseDC(hWnd, hDC));
 }