81 references to HandleCollector
System.Windows.Forms (81)
misc\DebugHandleTracker.cs (2)
45System.Internal.HandleCollector.HandleAdded += new System.Internal.HandleChangeEventHandler(tracker.OnHandleAdd); 46System.Internal.HandleCollector.HandleRemoved += new System.Internal.HandleChangeEventHandler(tracker.OnHandleRemove);
misc\GDI\SafeNativeMethods.cs (7)
42public static readonly int EMF = System.Internal.HandleCollector.RegisterType("EnhancedMetaFile", 20, 500); 47public static readonly int GDI = System.Internal.HandleCollector.RegisterType("GDI", 90, 50); 53public static readonly int HDC = System.Internal.HandleCollector.RegisterType("HDC", 100, 2); // wait for 2 dc's before collecting 65IntPtr hBrush = System.Internal.HandleCollector.Add(IntCreateSolidBrush(crColor), IntSafeNativeMethods.CommonHandles.GDI); 79IntPtr hPen = System.Internal.HandleCollector.Add(IntCreatePen(fnStyle, nWidth, crColor), IntSafeNativeMethods.CommonHandles.GDI); 91IntPtr hPen = System.Internal.HandleCollector.Add(IntExtCreatePen(fnStyle, dwWidth, lplb, dwStyleCount, lpStyle), IntSafeNativeMethods.CommonHandles.GDI); 105IntPtr hRgn = System.Internal.HandleCollector.Add(IntCreateRectRgn(x1, y1, x2, y2), IntSafeNativeMethods.CommonHandles.GDI);
misc\GDI\UnsafeNativeMethods.cs (9)
43IntPtr hdc = System.Internal.HandleCollector.Add(IntGetDC(hWnd), IntSafeNativeMethods.CommonHandles.HDC); 56System.Internal.HandleCollector.Remove((IntPtr)hDC, IntSafeNativeMethods.CommonHandles.GDI); 62System.Internal.HandleCollector.Remove((IntPtr)hDC, IntSafeNativeMethods.CommonHandles.HDC); 72System.Internal.HandleCollector.Remove((IntPtr)hDC, IntSafeNativeMethods.CommonHandles.HDC); 86IntPtr hdc = System.Internal.HandleCollector.Add(IntCreateDC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), IntSafeNativeMethods.CommonHandles.HDC); 100IntPtr hdc = System.Internal.HandleCollector.Add(IntCreateIC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), IntSafeNativeMethods.CommonHandles.HDC); 116IntPtr compatibleDc = System.Internal.HandleCollector.Add(IntCreateCompatibleDC(hDC), IntSafeNativeMethods.CommonHandles.GDI); 242IntPtr hFont = System.Internal.HandleCollector.Add(IntCreateFontIndirect(lf), IntSafeNativeMethods.CommonHandles.GDI); 253System.Internal.HandleCollector.Remove((IntPtr)hObject, IntSafeNativeMethods.CommonHandles.GDI);
misc\GDI\WindowsRegion.cs (1)
83System.Internal.HandleCollector.Add(hRegion, IntSafeNativeMethods.CommonHandles.GDI);
misc\HandleCollector.cs (4)
157if (HandleCollector.HandleAdded != null) { 158HandleCollector.HandleAdded(name, handle, currentCount); 258if (HandleCollector.HandleRemoved != null) { 259HandleCollector.HandleRemoved(name, handle, currentCount);
winforms\Managed\System\WinForms\Control.cs (4)
6568System.Internal.HandleCollector.Add(handle, NativeMethods.CommonHandles.GDI); 12116System.Internal.HandleCollector.SuspendCollect(); 12205System.Internal.HandleCollector.ResumeCollect(); 19992System.Internal.HandleCollector.Add(handle, NativeMethods.CommonHandles.GDI);
winforms\Managed\System\WinForms\ControlPaint.cs (1)
331return System.Internal.HandleCollector.Add(colorMask, NativeMethods.CommonHandles.GDI);;
winforms\Managed\System\WinForms\DataObject.cs (1)
1630System.Internal.HandleCollector.Add(medium.unionmember, NativeMethods.CommonHandles.GDI);
winforms\Managed\System\WinForms\ErrorProvider.cs (1)
1251System.Internal.HandleCollector.Add(windowRegionHandle, NativeMethods.CommonHandles.GDI);
winforms\Managed\System\WinForms\NativeMethods.cs (11)
6137public static readonly int Accelerator = System.Internal.HandleCollector.RegisterType("Accelerator", 80, 50); 6143public static readonly int Cursor = System.Internal.HandleCollector.RegisterType("Cursor", 20, 500); 6149public static readonly int EMF = System.Internal.HandleCollector.RegisterType("EnhancedMetaFile", 20, 500); 6155public static readonly int Find = System.Internal.HandleCollector.RegisterType("Find", 0, 1000); 6161public static readonly int GDI = System.Internal.HandleCollector.RegisterType("GDI", 50, 500); 6168public static readonly int HDC = System.Internal.HandleCollector.RegisterType("HDC", 100, 2); // wait for 2 dc's before collecting 6174public static readonly int CompatibleHDC = System.Internal.HandleCollector.RegisterType("ComptibleHDC", 50, 50); // wait for 2 dc's before collecting 6180public static readonly int Icon = System.Internal.HandleCollector.RegisterType("Icon", 20, 500); 6186public static readonly int Kernel = System.Internal.HandleCollector.RegisterType("Kernel", 0, 1000); 6192public static readonly int Menu = System.Internal.HandleCollector.RegisterType("Menu", 30, 1000); 6198public static readonly int Window = System.Internal.HandleCollector.RegisterType("Window", 5, 1000);
winforms\Managed\System\WinForms\NativeWindow.cs (2)
781System.Internal.HandleCollector.Add(createResult, NativeMethods.CommonHandles.Window); 1156System.Internal.HandleCollector.Remove(handle, NativeMethods.CommonHandles.Window);
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (1)
3872System.Internal.HandleCollector.Add(hFont, NativeMethods.CommonHandles.GDI);
winforms\Managed\System\WinForms\SafeNativeMethods.cs (14)
64return System.Internal.HandleCollector.Add(IntCreateCompatibleBitmap(hDC, width, height), NativeMethods.CommonHandles.GDI); 165System.Internal.HandleCollector.Remove((IntPtr)hObject, NativeMethods.CommonHandles.GDI); 179return System.Internal.HandleCollector.Add(IntCreateSolidBrush(crColor), NativeMethods.CommonHandles.GDI); 350return System.Internal.HandleCollector.Add(IntCreateHalftonePalette(hdc), NativeMethods.CommonHandles.GDI); 406return System.Internal.HandleCollector.Add(IntCreateDIBSection(hdc, pbmi, iUsage, ppvBits, hSection, dwOffset), NativeMethods.CommonHandles.GDI); 415return System.Internal.HandleCollector.Add(IntCreateBitmap(nWidth, nHeight, nPlanes, nBitsPerPixel, lpvBits), NativeMethods.CommonHandles.GDI); 424return System.Internal.HandleCollector.Add(IntCreateBitmapShort(nWidth, nHeight, nPlanes, nBitsPerPixel, lpvBits), NativeMethods.CommonHandles.GDI); 433return System.Internal.HandleCollector.Add(IntCreateBitmapByte(nWidth, nHeight, nPlanes, nBitsPerPixel, lpvBits), NativeMethods.CommonHandles.GDI); 441return System.Internal.HandleCollector.Add(IntCreatePatternBrush(hbmp), NativeMethods.CommonHandles.GDI); 449return System.Internal.HandleCollector.Add(IntCreateBrushIndirect(lb), NativeMethods.CommonHandles.GDI); 457return System.Internal.HandleCollector.Add(IntCreatePen(nStyle, nWidth, crColor), NativeMethods.CommonHandles.GDI); 484return System.Internal.HandleCollector.Add(IntCopyImage(hImage, uType, cxDesired, cyDesired, fuFlags), NativeMethods.CommonHandles.GDI); 487return System.Internal.HandleCollector.Add(IntCopyImage(hImage, uType, cxDesired, cyDesired, fuFlags), NativeMethods.CommonHandles.Cursor); 567return System.Internal.HandleCollector.Add(IntCreateRectRgn(x1, y1, x2, y2), NativeMethods.CommonHandles.GDI);
winforms\Managed\System\WinForms\UnsafeNativeMethods.cs (23)
439return System.Internal.HandleCollector.Add(IntCreateMenu(), NativeMethods.CommonHandles.Menu); 488System.Internal.HandleCollector.Add(handleTarget, NativeMethods.CommonHandles.Kernel); 597System.Internal.HandleCollector.Remove((IntPtr)handle, NativeMethods.CommonHandles.Kernel); 607return System.Internal.HandleCollector.Add(IntCreateCompatibleDC(hDC), NativeMethods.CommonHandles.CompatibleHDC); 644return System.Internal.HandleCollector.Add(IntMapViewOfFile(hFileMapping, dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap), NativeMethods.CommonHandles.Kernel); 651System.Internal.HandleCollector.Remove((IntPtr)pvBaseAddress, NativeMethods.CommonHandles.Kernel); 661return System.Internal.HandleCollector.Add(IntGetDCEx(hWnd, hrgnClip, flags), NativeMethods.CommonHandles.HDC); 707return System.Internal.HandleCollector.Add(IntCreateAcceleratorTable(pentries, cCount), NativeMethods.CommonHandles.Accelerator); 713System.Internal.HandleCollector.Remove((IntPtr)hAccel, NativeMethods.CommonHandles.Accelerator); 748System.Internal.HandleCollector.Remove((IntPtr)hrgn, NativeMethods.CommonHandles.GDI); 1276return System.Internal.HandleCollector.Add(IntBeginPaint(hWnd, ref lpPaint), NativeMethods.CommonHandles.HDC); 1283System.Internal.HandleCollector.Remove(lpPaint.hdc, NativeMethods.CommonHandles.HDC); 1293return System.Internal.HandleCollector.Add(IntGetDC(hWnd), NativeMethods.CommonHandles.HDC); 1302return System.Internal.HandleCollector.Add(IntGetWindowDC(hWnd), NativeMethods.CommonHandles.HDC); 1309System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC); 1320return System.Internal.HandleCollector.Add(IntCreateDC(lpszDriver, null, null, NativeMethods.NullHandleRef), NativeMethods.CommonHandles.HDC); 1325return System.Internal.HandleCollector.Add(IntCreateDC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), NativeMethods.CommonHandles.HDC); 1442return System.Internal.HandleCollector.Add(IntCreatePopupMenu(), NativeMethods.CommonHandles.Menu); 1453System.Internal.HandleCollector.Remove((IntPtr)hMenu, NativeMethods.CommonHandles.Menu); 1508return System.Internal.HandleCollector.Add(IntCreateIC(lpszDriverName, lpszDeviceName, lpszOutput, lpInitData), NativeMethods.CommonHandles.HDC); 1535System.Internal.HandleCollector.Remove((IntPtr)hCurs, NativeMethods.CommonHandles.Cursor); 1547System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.HDC); 1553System.Internal.HandleCollector.Remove((IntPtr)hDC, NativeMethods.CommonHandles.CompatibleHDC);