public static IntPtr GetDC(HandleRef hWnd) { IntPtr hDc = IntGetDC(hWnd); if (hDc == IntPtr.Zero) { throw new Win32Exception(); } return(HandleCollector.Add(hDc, NativeMethods.CommonHandles.HDC)); }
public static int ReleaseDC(HandleRef hWnd, HandleRef hDC) { HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC); return(IntReleaseDC(hWnd, hDC)); }