예제 #1
0
        internal static IntPtr GetDC(HandleRef hWnd)
        {
            var hDc = IntGetDC(hWnd);

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

            return(HandleCollector.Add(hDc, CommonHandles.HDC));
        }
예제 #2
0
 protected override void Dispose(bool disposing)
 {
     HandleCollector.Remove(_collectorId);
     base.Dispose(disposing);
 }
예제 #3
0
 protected WpfSafeHandle(bool ownsHandle, int collectorId) : base(ownsHandle)
 {
     HandleCollector.Add(collectorId);
     _collectorId = collectorId;
 }
예제 #4
0
 internal static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
 {
     HandleCollector.Remove((IntPtr)hDC, CommonHandles.HDC);
     return(IntReleaseDC(hWnd, hDC));
 }