1 interface inheriting from IHandle
System.Private.Windows.GdiPlus (1)
System\Drawing\IIcon.cs (1)
6internal interface IIcon : IHandle<HICON>
22 implementations of IHandle
System.Private.Windows.Core (7)
Windows\Win32\Foundation\HandleRef.cs (1)
22internal readonly struct HandleRef<THandle> : IHandle<THandle>, IEquatable<HandleRef<THandle>>
Windows\Win32\Foundation\HWND.cs (1)
6internal partial struct HWND : IHandle<HWND>
Windows\Win32\Foundation\NullHandle.cs (1)
6internal class NullHandle<T> : IHandle<T> where T : unmanaged
Windows\Win32\Graphics\Gdi\HDC.cs (1)
6internal readonly partial struct HDC : IHandle<HDC>
Windows\Win32\Graphics\Gdi\HdcHandle.cs (1)
10internal sealed class HdcHandle : IDisposable, IHandle<HDC>
Windows\Win32\UI\WindowsAndMessaging\HCURSOR.cs (1)
6internal unsafe partial struct HCURSOR : IHandle<HCURSOR>
Windows\Win32\UI\WindowsAndMessaging\HICON.cs (1)
6internal unsafe partial struct HICON : IHandle<HICON>
System.Windows.Forms (13)
System\Windows\Forms\Application.ThreadContext.cs (1)
19internal abstract unsafe partial class ThreadContext : MarshalByRefObject, IHandle<HANDLE>
System\Windows\Forms\Control.cs (1)
48IHandle<HWND>
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
24public sealed partial class ImageList : Component, IHandle<HIMAGELIST>
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
11internal sealed class NativeImageList : IDisposable, IHandle<HIMAGELIST>
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (1)
8internal class CachedItemHdcInfo : IDisposable, IHandle<HDC>
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (1)
13internal class IconRegion : IHandle<HICON>
System\Windows\Forms\Input\Cursor.cs (3)
20public sealed class Cursor : IDisposable, ISerializable, IHandle<HICON>, IHandle<HANDLE>, IHandle<HCURSOR>
System\Windows\Forms\NativeWindow.cs (1)
14public unsafe partial class NativeWindow : MarshalByRefObject, IWin32Window, IHandle<HWND>
System\Windows\Forms\ToolTip\ToolTip.cs (1)
17public partial class ToolTip : Component, IExtenderProvider, IHandle<HWND>
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
13public sealed class VisualStyleRenderer : IHandle<HTHEME> 872private class ThemeHandle : IDisposable, IHandle<HTHEME>
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Message.cs (1)
11public struct Message : IEquatable<Message>, IHandle<HWND>
System.Windows.Forms.Primitives.TestUtilities (1)
Win32\Window.cs (1)
8internal class Window : IDisposable, IHandle<HWND>
162 references to IHandle
System.Private.Windows.Core (47)
Windows\Win32\Foundation\HandleRef.cs (2)
10/// Adapter to use when owning classes cannot directly implement <see cref="IHandle{T}"/>. 36public HandleRef(IHandle<THandle>? handle)
Windows\Win32\Foundation\HWND.cs (2)
8HWND IHandle<HWND>.Handle => this; 9object? IHandle<HWND>.Wrapper => null;
Windows\Win32\Foundation\IHandle.cs (3)
24/// <see cref="IHandle{THandle}"/>, but should take a generic "T" that is constrained to IHandle{T}. Doing 39/// <see cref="IHandle{THandle}"/> implementer. 44/// <see cref="IHandle{THandle}"/> is on a struct. See <see cref="HandleRef{THandle}"/> for a concrete usage.
Windows\Win32\Graphics\Gdi\HDC.cs (2)
8HDC IHandle<HDC>.Handle => this; 9object? IHandle<HDC>.Wrapper => null;
Windows\Win32\PInvokeCore.BitBlt.cs (2)
18ROP_CODE rop) where T : IHandle<HDC> 44ROP_CODE rop) where T : IHandle<HDC>
Windows\Win32\PInvokeCore.CallWindowProc.cs (1)
9where T : IHandle<HWND>
Windows\Win32\PInvokeCore.CopyImage.cs (2)
10where T : IHandle<HICON> 19where T : IHandle<HCURSOR>
Windows\Win32\PInvokeCore.DragAcceptFiles.cs (1)
9public static void DragAcceptFiles<T>(T hWnd, BOOL fAccept) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.DrawIcon.cs (1)
9where T : IHandle<HICON>
Windows\Win32\PInvokeCore.DrawIconEx.cs (1)
17where T : IHandle<HICON>
Windows\Win32\PInvokeCore.EnumChildWindows.cs (1)
14where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetClientRect.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetIconInfo.cs (1)
10where T : IHandle<HICON>
Windows\Win32\PInvokeCore.GetWindowLong.cs (1)
28where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowRect.cs (1)
9public static BOOL GetWindowRect<T>(T hWnd, out RECT lpRect) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowText.cs (1)
15public static unsafe string GetWindowText<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowTextLength.cs (1)
9public static int GetWindowTextLength<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowThreadProcessId.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvokeCore.MapWindowPoints.cs (4)
12where TFrom : IHandle<HWND> 13where TTo : IHandle<HWND> 26where TFrom : IHandle<HWND> 27where TTo : IHandle<HWND>
Windows\Win32\PInvokeCore.PeekMessage.cs (1)
15where T : IHandle<HWND>
Windows\Win32\PInvokeCore.PostMessage.cs (1)
14where T : IHandle<HWND>
Windows\Win32\PInvokeCore.RegisterDragDrop.cs (1)
12where T : IHandle<HWND>
Windows\Win32\PInvokeCore.RevokeDragDrop.cs (1)
9public static HRESULT RevokeDragDrop<T>(T hwnd) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.SendMessage.cs (6)
13LPARAM lParam = default) where T : IHandle<HWND> 25LPARAM lParam = default) where THwnd : IHandle<HWND> where TWParam : IHandle<HWND> 37string? lParam) where T : IHandle<HWND> 51where THwnd : IHandle<HWND> 66where THwnd : IHandle<HWND>
Windows\Win32\PInvokeCore.SetWindowLong.cs (4)
17where T : IHandle<HWND> 27where THwnd : IHandle<HWND> 28where TNewValue : IHandle<HWND> 36where T : IHandle<HWND>
Windows\Win32\UI\WindowsAndMessaging\HCURSOR.cs (2)
8HCURSOR IHandle<HCURSOR>.Handle => this; 9object? IHandle<HCURSOR>.Wrapper => null;
Windows\Win32\UI\WindowsAndMessaging\HICON.cs (2)
8HICON IHandle<HICON>.Handle => this; 9object? IHandle<HICON>.Wrapper => null;
System.Private.Windows.GdiPlus (1)
Windows\Win32\Graphics\Gdi\HdcExtensions.cs (1)
20where T : IHandle<HDC>
System.Windows.Forms (25)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
25private readonly IHandle<HWND> _owningChildEdit;
System\Windows\Forms\Application.cs (2)
1131internal static unsafe ThreadContext GetContextForHandle<T>(T handle) where T : IHandle<HWND> 1236internal static void UnparkHandle(IHandle<HWND> handle, DPI_AWARENESS_CONTEXT context)
System\Windows\Forms\Application.ParkingWindow.cs (3)
107internal void ParkHandle<T>(T handle) where T : IHandle<HWND> 114PInvoke.SetParent(handle, (IHandle<HWND>)this); 120internal void UnparkHandle<T>(T handle) where T : IHandle<HWND>
System\Windows\Forms\Application.ThreadContext.cs (1)
521HANDLE IHandle<HANDLE>.Handle => Handle;
System\Windows\Forms\Control.cs (1)
12935HWND IHandle<HWND>.Handle => HWND;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
28private readonly IHandle<HWND> _owningChildEdit;
System\Windows\Forms\Controls\ImageList\ImageList.cs (1)
759HIMAGELIST IHandle<HIMAGELIST>.Handle => HIMAGELIST;
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
62HIMAGELIST IHandle<HIMAGELIST>.Handle => HIMAGELIST;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (4)
496private static bool IsChildOrSameWindow<T>(in T hwndParent, in T hwndChild) where T : IHandle<HWND> 580if (!IsChildOrSameWindow<IHandle<HWND>>(activeToolStripHandle, m)) 585if (toplevelToolStrip is not null && IsChildOrSameWindow<IHandle<HWND>>(toplevelToolStrip, m)) 594else if (!IsChildOrSameWindow<IHandle<HWND>>(ActiveHwnd, m))
System\Windows\Forms\Form.cs (2)
2004private IHandle<HWND> TaskbarOwner 6107IHandle<HWND> ownerHwnd = NullHandle<HWND>.Instance;
System\Windows\Forms\Input\Cursor.cs (3)
214HICON IHandle<HICON>.Handle => (HICON)Handle; 216HANDLE IHandle<HANDLE>.Handle => (HANDLE)Handle; 217HCURSOR IHandle<HCURSOR>.Handle => _handle;
System\Windows\Forms\NativeWindow.cs (2)
155HWND IHandle<HWND>.Handle => HWND; 278internal static short CreateWindowId(IHandle<HWND> handle)
System\Windows\Forms\StringSource.cs (1)
40public bool Bind(IHandle<HWND> edit, AUTOCOMPLETEOPTIONS options)
System\Windows\Forms\ToolTip\ToolTip.cs (1)
257HWND IHandle<HWND>.Handle => HWND;
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
179HTHEME IHandle<HTHEME>.Handle => (HTHEME)Handle;
System.Windows.Forms.Primitives (85)
System\Windows\Forms\Automation\UiaTextProvider.cs (2)
75public static WINDOW_EX_STYLE GetWindowExStyle(IHandle<HWND> hWnd) => 78public static WINDOW_STYLE GetWindowStyle(IHandle<HWND> hWnd) =>
System\Windows\Forms\Message.cs (1)
82readonly HWND IHandle<HWND>.Handle => HWND;
Windows\Win32\PInvoke.ChildWindowFromPointEx.cs (1)
12where T : IHandle<HWND>
Windows\Win32\PInvoke.ClientToScreen.cs (1)
12where T : IHandle<HWND>
Windows\Win32\PInvoke.CloseHandle.cs (1)
9public static BOOL CloseHandle<T>(T handle) where T : IHandle<HANDLE>
Windows\Win32\PInvoke.DestroyAcceleratorTable.cs (1)
10where T : IHandle<HACCEL>
Windows\Win32\PInvoke.DrawMenuBar.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.EnableMenuItem.cs (1)
10where T : IHandle<HMENU>
Windows\Win32\PInvoke.EnableScrollBar.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.EnableWindow.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.EndDialog.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.FillRect.cs (1)
10where T : IHandle<HDC>
Windows\Win32\PInvoke.GetAncestor.cs (1)
9public static HWND GetAncestor<T>(T hwnd, GET_ANCESTOR_FLAGS flags) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetDlgItem.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetDpiForWindow.cs (1)
9public static uint GetDpiForWindow<T>(T hwnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetMenu.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetMenuItemCount.cs (1)
10where T : IHandle<HMENU>
Windows\Win32\PInvoke.GetParent.cs (1)
9public static HWND GetParent<T>(T hwnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetScrollInfo.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetSystemMenu.cs (1)
9public static HMENU GetSystemMenu<T>(T hwnd, BOOL bRevert) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetTextExtentPoint32.cs (1)
11public static unsafe BOOL GetTextExtentPoint32W<T>(T hdc, string lpString, int c, Size size) where T : IHandle<HDC>
Windows\Win32\PInvoke.GetThemeFont.cs (1)
12where T : IHandle<HTHEME>
Windows\Win32\PInvoke.GetWindow.cs (1)
9public static HWND GetWindow<T>(T hWnd, GET_WINDOW_CMD uCmd) where T : IHandle<HWND>
Windows\Win32\PInvoke.HtmlHelp.cs (3)
12where T : IHandle<HWND> 21where T : IHandle<HWND> 37where TCaller : IHandle<HWND>
Windows\Win32\PInvoke.ImageList.cs (15)
13public static int Add<T>(T himl, HBITMAP hbmImage, HBITMAP hbmMask) where T : IHandle<HIMAGELIST> 21public static bool Destroy<T>(T himl) where T : IHandle<HIMAGELIST> 30where T : IHandle<HIMAGELIST> 48IMAGE_LIST_DRAW_STYLE fStyle) where THIML : IHandle<HIMAGELIST> where THDC : IHandle<HDC> 57public static bool GetIconSize<T>(T himl, out int x, out int y) where T : IHandle<HIMAGELIST> 69public static int GetImageCount<T>(T himl) where T : IHandle<HIMAGELIST> 77public static bool GetImageInfo<T>(T himl, int i, out IMAGEINFO pImageInfo) where T : IHandle<HIMAGELIST> 85public static bool Remove<T>(T himl, int i) where T : IHandle<HIMAGELIST> 93public static bool Replace<T>(T himl, int i, HBITMAP hbmImage, HBITMAP hbmMask) where T : IHandle<HIMAGELIST> 104THICON hicon) where THIML : IHandle<HIMAGELIST> where THICON : IHandle<HICON> 113public static COLORREF SetBkColor<T>(T himl, COLORREF clrBk) where T : IHandle<HIMAGELIST> 121public static BOOL Write<T>(T himl, Stream pstm) where T : IHandle<HIMAGELIST> 133Stream pstm) where T : IHandle<HIMAGELIST>
Windows\Win32\PInvoke.ImmGetContext.cs (1)
11public static HIMC ImmGetContext<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.ImmReleaseContext.cs (1)
11public static BOOL ImmReleaseContext<T>(T hWnd, HIMC hIMC) where T : IHandle<HWND>
Windows\Win32\PInvoke.IntersectClipRect.cs (1)
9public static GDI_REGION_TYPE IntersectClipRect<T>(T hdc, int left, int top, int right, int bottom) where T : IHandle<HDC>
Windows\Win32\PInvoke.InvalidateRect.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.InvalidateRgn.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.IsAccelerator.cs (1)
10where T : IHandle<HACCEL>
Windows\Win32\PInvoke.IsChild.cs (2)
10where TParent : IHandle<HWND> 11where TChild : IHandle<HWND>
Windows\Win32\PInvoke.IsWindow.cs (1)
9public static BOOL IsWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.IsWindowEnabled.cs (1)
9public static BOOL IsWindowEnabled<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.IsWindowVisible.cs (1)
9public static BOOL IsWindowVisible<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.KillTimer.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.NotifyWinEvent.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.RedrawWindow.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.ScreenToClient.cs (1)
12where T : IHandle<HWND>
Windows\Win32\PInvoke.ScrollWindow.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.ScrollWindowEx.cs (1)
17SCROLL_WINDOW_FLAGS flags) where T : IHandle<HWND>
Windows\Win32\PInvoke.SendMessageCallback.cs (1)
17where T : IHandle<HWND>
Windows\Win32\PInvoke.SetActiveWindow.cs (1)
9public static HWND SetActiveWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetCapture.cs (1)
9public static IntPtr SetCapture<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetFocus.cs (1)
9public static HWND SetFocus<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetForegroundWindow.cs (1)
9public static BOOL SetForegroundWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetLayeredWindowAttributes.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetMenu.cs (3)
10where T : IHandle<HWND> 19where T1 : IHandle<HWND> 20where T2 : IHandle<HMENU>
Windows\Win32\PInvoke.SetParent.cs (2)
10where TChild : IHandle<HWND> 11where TParent : IHandle<HWND>
Windows\Win32\PInvoke.SetScrollInfo.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetScrollPos.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetTimer.cs (1)
9where T : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowPos.cs (2)
10where T1 : IHandle<HWND> 11where T2 : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowRgn.cs (1)
10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowText.cs (1)
9public static BOOL SetWindowText<T>(T hWnd, string text) where T : IHandle<HWND>
Windows\Win32\PInvoke.SHAutoComplete.cs (1)
9public static HRESULT SHAutoComplete<T>(T hwndEdit, SHELL_AUTOCOMPLETE_FLAGS flags) where T : IHandle<HWND>
Windows\Win32\PInvoke.ShowWindow.cs (1)
9public static BOOL ShowWindow<T>(T hWnd, SHOW_WINDOW_CMD nCmdShow) where T : IHandle<HWND>
Windows\Win32\PInvoke.UiaHostProviderFromHwnd.cs (1)
11public static unsafe HRESULT UiaHostProviderFromHwnd<T>(T hwnd, out IRawElementProviderSimple* ppProvider) where T : IHandle<HWND>
Windows\Win32\PInvoke.UiaReturnRawElementProvider.cs (1)
16where T : IHandle<HWND>
Windows\Win32\PInvoke.UpdateWindow.cs (1)
9public static BOOL UpdateWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.ValidateRect.cs (1)
10where T : IHandle<HWND>
Windows\Win32\UI\Controls\ToolInfoWrapper.cs (2)
7where T : IHandle<HWND> 36public LRESULT SendMessage(IHandle<HWND> sender, MessageId message, bool state = false)
System.Windows.Forms.Tests (4)
System\Windows\Forms\ComboBox.ComboBoxUiaTextProviderTests.cs (4)
1117int actualValue = (int)PInvokeCore.SendMessage((IHandle<HWND>)comboBox.TestAccessor().Dynamic._childEdit, PInvokeCore.EM_GETFIRSTVISIBLELINE); 1131int actualValue = (int)PInvokeCore.SendMessage((IHandle<HWND>)comboBox.TestAccessor().Dynamic._childEdit, PInvokeCore.EM_GETLINECOUNT); 1157int expectedLine = (int)PInvokeCore.SendMessage((IHandle<HWND>)comboBox.TestAccessor().Dynamic._childEdit, PInvokeCore.EM_LINEFROMCHAR, (WPARAM)charIndex); 1178bool expectedValue = PInvokeCore.SendMessage((IHandle<HWND>)comboBox.TestAccessor().Dynamic._childEdit, PInvokeCore.EM_LINESCROLL, 0, newLine) != 0;