976 references to HWND
System.Drawing.Common (2)
System\Drawing\Graphics.cs (1)
121Gdip.CheckStatus(PInvokeGdiPlus.GdipCreateFromHWND((HWND)hwnd, &nativeGraphics));
System\Drawing\Printing\PageSettings.cs (1)
326HWND.Null,
System.Drawing.Common.Tests (4)
Helpers.cs (2)
130internal static Rectangle GetHWndRect(HWND hwnd) 141private static Rectangle GetMonitorRectForWindow(HWND hwnd)
System\Drawing\GraphicsTests.cs (2)
219Rectangle expected = Helpers.GetHWndRect((HWND)hwnd); 228Rectangle expected = Helpers.GetHWndRect((HWND)hwnd);
System.Private.Windows.Core (87)
System\Private\Windows\Ole\DragDropHelper.cs (2)
44public static void DragEnter(HWND targetWindowHandle, IDragEvent e) 59public static void DragEnter(HWND targetWindowHandle, IComVisibleDataObject dataObject, ref Point point, DROPEFFECT effect)
Windows\Win32\Foundation\HWND.cs (4)
6internal partial struct HWND : IHandle<HWND> 8HWND IHandle<HWND>.Handle => this; 9object? IHandle<HWND>.Wrapper => null;
Windows\Win32\Foundation\LPARAM.cs (3)
22public static explicit operator HWND(LPARAM value) => (HWND)value.Value; 24public static unsafe explicit operator LPARAM(HWND value) => (LPARAM)value.Value;
Windows\Win32\Foundation\LRESULT.cs (2)
12public static explicit operator HWND(LRESULT value) => (HWND)value.Value;
Windows\Win32\Foundation\WPARAM.cs (3)
13public static explicit operator HWND(WPARAM value) => (HWND)(nint)value.Value; 14public static explicit operator WPARAM(HWND value) => new((nuint)value.Value);
Windows\Win32\Graphics\Gdi\BeginPaintScope.cs (3)
9/// Helper to scope lifetime of an HDC retrieved via <see cref="PInvokeCore.BeginPaint(HWND, out PAINTSTRUCT)"/> 26public HWND HWND { get; } 29public BeginPaintScope(HWND hwnd)
Windows\Win32\Graphics\Gdi\GetDcScope.cs (6)
7/// Helper to scope lifetime of an <see cref="Gdi.HDC"/> retrieved via <see cref="PInvokeCore.GetDC(HWND)"/> and 8/// <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. Releases the <see cref="Gdi.HDC"/> (if any) 20public HWND HWND { get; } 22public GetDcScope(HWND hwnd) 29/// Creates a <see cref="Gdi.HDC"/> using <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. 40public GetDcScope(HWND hwnd, HRGN hrgnClip, GET_DCX_FLAGS flags)
Windows\Win32\PInvokeCore.CallWindowProc.cs (2)
9where T : IHandle<HWND> 12(delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)lpPrevWndFunc,
Windows\Win32\PInvokeCore.DragAcceptFiles.cs (2)
8/// <inheritdoc cref="DragAcceptFiles(HWND, BOOL)"/> 9public static void DragAcceptFiles<T>(T hWnd, BOOL fAccept) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.EnumChildWindows.cs (3)
11public delegate BOOL EnumChildWindowsCallback(HWND hWnd); 14where T : IHandle<HWND> 32private static BOOL EnumChildWindowsNativeCallback(HWND hWnd, LPARAM lParam)
Windows\Win32\PInvokeCore.EnumThreadWindows.cs (2)
11public delegate BOOL EnumThreadWindowsCallback(HWND hWnd); 33private static BOOL HandleEnumThreadWindowsNativeCallback(HWND hWnd, LPARAM lParam)
Windows\Win32\PInvokeCore.EnumWindows.cs (2)
11public delegate BOOL EnumWindowsCallback(HWND hWnd); 30private static BOOL EnumWindowsNativeCallback(HWND hWnd, LPARAM lParam)
Windows\Win32\PInvokeCore.GetClassLong.cs (3)
13private static extern nint GetClassLongW(HWND hWnd, GET_CLASS_LONG_INDEX nIndex); 17private static extern nint GetClassLongPtrW(HWND hWnd, GET_CLASS_LONG_INDEX nIndex); 19public static IntPtr GetClassLong(HWND hWnd, GET_CLASS_LONG_INDEX nIndex)
Windows\Win32\PInvokeCore.GetClientRect.cs (2)
8/// <inheritdoc cref="GetClientRect(HWND, out RECT)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowLong.cs (3)
11private static extern nint GetWindowLongW(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex); 14private static extern nint GetWindowLongPtrW(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex); 28where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowRect.cs (2)
8/// <inheritdoc cref="GetWindowRect(HWND, out RECT)"/> 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 (2)
8/// <inheritdoc cref="GetWindowTextLength(HWND)"/> 9public static int GetWindowTextLength<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.GetWindowThreadProcessId.cs (2)
8/// <inheritdoc cref="GetWindowThreadProcessId(HWND, uint*)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvokeCore.MapWindowPoints.cs (8)
10/// <inheritdoc cref="MapWindowPoints(HWND, HWND, Point*, uint)"/> 12where TFrom : IHandle<HWND> 13where TTo : IHandle<HWND> 24/// <inheritdoc cref="MapWindowPoints(HWND, HWND, Point*, uint)"/> 26where TFrom : IHandle<HWND> 27where TTo : IHandle<HWND>
Windows\Win32\PInvokeCore.PeekMessage.cs (2)
8/// <inheritdoc cref="PeekMessage(MSG*, HWND, uint, uint, PEEK_MESSAGE_REMOVE_TYPE)"/> 15where T : IHandle<HWND>
Windows\Win32\PInvokeCore.PostMessage.cs (2)
8/// <inheritdoc cref="PostMessage(HWND, uint, WPARAM, LPARAM)"/> 14where T : IHandle<HWND>
Windows\Win32\PInvokeCore.RegisterDragDrop.cs (2)
10/// <inheritdoc cref="RegisterDragDrop(HWND, IDropTarget*)"/> 12where T : IHandle<HWND>
Windows\Win32\PInvokeCore.RevokeDragDrop.cs (2)
8/// <inheritdoc cref="RevokeDragDrop(HWND)"/> 9public static HRESULT RevokeDragDrop<T>(T hwnd) where T : IHandle<HWND>
Windows\Win32\PInvokeCore.SendMessage.cs (11)
8/// <inheritdoc cref="SendMessage(HWND, uint, WPARAM, LPARAM)"/> 13LPARAM lParam = default) where T : IHandle<HWND> 20/// <inheritdoc cref="SendMessage(HWND, uint, WPARAM, LPARAM)"/> 25LPARAM lParam = default) where THwnd : IHandle<HWND> where TWParam : IHandle<HWND> 32/// <inheritdoc cref="SendMessage(HWND, uint, WPARAM, LPARAM)"/> 37string? lParam) where T : IHandle<HWND> 45/// <inheritdoc cref="SendMessage(HWND, uint, WPARAM, LPARAM)"/> 51where THwnd : IHandle<HWND> 60/// <inheritdoc cref="SendMessage(HWND, uint, WPARAM, LPARAM)"/> 66where THwnd : IHandle<HWND>
Windows\Win32\PInvokeCore.SetClassLong.cs (3)
12private static extern nint SetClassLongW(HWND hwnd, GET_CLASS_LONG_INDEX nIndex, nint dwNewLong); 15private static extern nint SetClassLongPtrW(HWND hwnd, GET_CLASS_LONG_INDEX nIndex, nint dwNewLong); 17public static nint SetClassLong(HWND hWnd, GET_CLASS_LONG_INDEX nIndex, nint dwNewLong)
Windows\Win32\PInvokeCore.SetWindowLong.cs (6)
11private static extern nint SetWindowLongW(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex, nint dwNewLong); 14private static extern nint SetWindowLongPtrW(HWND hWnd, WINDOW_LONG_PTR_INDEX nIndex, nint dwNewLong); 17where T : IHandle<HWND> 27where THwnd : IHandle<HWND> 28where TNewValue : IHandle<HWND> 36where T : IHandle<HWND>
Windows\Win32\UI\Controls\Dialogs\PRINTDLGEXW.cs (1)
52public HWND hwndOwner;
Windows\Win32\UI\WindowsAndMessaging\WNDPROC.cs (1)
6internal delegate LRESULT WNDPROC(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam);
System.Private.Windows.GdiPlus (2)
Windows\Win32\Graphics\GdiPlus\GpRegionExtensions.cs (2)
20/// Creates a native region from a GDI+ <see cref="GpRegion"/> and <see cref="HWND"/>. 22public static RegionScope GetRegionScope(this IPointer<GpRegion> region, HWND hwnd)
System.Windows.Forms (543)
System\Windows\Forms\Accessibility\AccessibleObject.cs (6)
2512/// <inheritdoc cref="IOleWindow.GetWindow(HWND*)"/> 2532HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd) 2554*phwnd = HWND.Null; 2729(HWND)handle, 2757(HWND)handle, 2998HRESULT IRawElementProviderHwndOverride.Interface.GetOverrideProviderForHwnd(HWND hwnd, IRawElementProviderSimple** pRetVal)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (7)
22private HWND _handle = HWND.Null; 255_handle = (HWND)value; 268internal HWND HandleInternal => _handle; 472new HandleRef<HWND>(Owner, HandleInternal), 524=> UIAHelper.WindowHandleToVariant(Owner?.InternalHandle ?? HWND.Null), 544PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, HandleInternal), out IRawElementProviderSimple* provider);
System\Windows\Forms\Accessibility\LabelEditAccessibleObject.cs (2)
41UIA_PROPERTY_ID.UIA_NativeWindowHandlePropertyId => UIAHelper.WindowHandleToVariant(_labelEdit.TryGetTarget(out var target) ? target.HWND : HWND.Null), 79_labelEdit.TryGetTarget(out var target) ? (int)target.HWND : (int)HWND.Null
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (4)
22HWND hwnd, 45var functionPointer = (delegate* unmanaged[Stdcall]<HWINEVENTHOOK, uint, HWND, int, int, uint, uint, void>) 71public bool IsHandleCreated => Handle != HWND.Null; 118private void WinEventProcCallback(HWINEVENTHOOK hWinEventHook, uint eventId, HWND hwnd, int idObject, int idChild, uint idEventThread, uint dwmsEventTime)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (4)
25private readonly IHandle<HWND> _owningChildEdit; 228PInvokeCore.MapWindowPoints(_owningChildEdit.Handle, HWND.Null, ref pt); 272if (PInvokeCore.MapWindowPoints(HWND.Null, _owningChildEdit.Handle, ref clientLocation) == 0) 308PInvokeCore.MapWindowPoints(_owningChildEdit.Handle, HWND.Null, ref r);
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (4)
608HRESULT IOleInPlaceFrame.Interface.GetWindow(HWND* phwnd) 704HRESULT IOleInPlaceFrame.Interface.SetMenu(HMENU hmenuShared, nint holemenu, HWND hwndActiveObject) => HRESULT.E_NOTIMPL; 714HRESULT IOleInPlaceUIWindow.Interface.GetWindow(HWND* phwnd) 732HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd)
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (2)
263public HWND Hwnd => GetControl()?.HWND ?? HWND.Null;
System\Windows\Forms\ActiveX\AxHost.cs (16)
123private HWND _hwndFocus; 817private HWND GetHandleNoCreate() => IsHandleCreated ? (HWND)Handle : default; 1249HWND handle = HWND; 1760hwnd = (ContainingControl is null) ? HWND.Null : ContainingControl.HWND, 2159parent is null ? HWND.Null : parent.HWND, 2971hWndOwner = (ContainingControl is null) ? HWND.Null : ContainingControl.HWND, 3026HWND handle = ContainingControl is null ? HWND.Null : ContainingControl.HWND; 3107_hwndFocus = (HWND)(nint)m.WParamInternal; 3139HWND hwnd = HWND.Null; 3142Application.ParkHandle(new HandleRef<HWND>(this, hwnd), DpiAwarenessContext); 3207HWND handle = GetHandleNoCreate(); 3213(delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)wndProc, 3238private void AttachWindow(HWND hwnd)
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (8)
102HWND hwnd, 110HWND hwnd, 305HWND hwnd = HWND.Null; 332HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd) 338HRESULT IOleInPlaceSite.Interface.GetWindow(HWND* phwnd) 345*phwnd = _host.ParentInternal?.HWND ?? HWND.Null; 402lpFrameInfo->hwndFrame = _host.ParentInternal?.HWND ?? HWND.Null;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (11)
270internal HWND HWNDParent { get; private set; } 331/// <inheritdoc cref="IOleObject.DoVerb(int, MSG*, IOleClientSite*, int, HWND, RECT*)"/> 337HWND hwndParent, 356HWND hwnd = lpmsg->hwnd; 360HWND hwndMap = hwnd.IsNull ? hwndParent : hwnd; 746/// <inheritdoc cref="IOleWindow.GetWindow(HWND*)"/> 747internal unsafe HRESULT GetWindow(HWND* phwnd) 756*phwnd = HWND.Null; 760*phwnd = (HWND)_control.Handle; 824HWND hwndParent = default; 1810HWND hWndParent = PInvoke.GetParent(_control);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (8)
83/// <inheritdoc cref="IOleWindow.GetWindow(HWND*)"/> 84HRESULT IOleInPlaceActiveObject.Interface.GetWindow(HWND* phwnd) 116/// <inheritdoc cref="IOleWindow.GetWindow(HWND*)"/> 117HRESULT IOleInPlaceObject.Interface.GetWindow(HWND* phwnd) => ActiveXInstance.GetWindow(phwnd); 205/// <inheritdoc cref="IOleObject.DoVerb(int, MSG*, IOleClientSite*, int, HWND, RECT*)"/> 211HWND hwndParent, 347/// <inheritdoc cref="IOleWindow.GetWindow(HWND*)"/> 348HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd) => ((IOleInPlaceObject.Interface)this).GetWindow(phwnd);
System\Windows\Forms\Application.ComponentManager.cs (4)
201return PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE); 231if (PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE)) 239PInvoke.GetMessage(&msg, HWND.Null, 0, 0); 309if (!PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE))
System\Windows\Forms\Application.ComponentThreadContext.cs (5)
292if (PInvoke.GetMessage(&msg, HWND.Null, 0, 0)) 309else if (!PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE)) 454if (!PInvokeCore.PeekMessage(&temp, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE)) 478HWND IMsoComponent.Interface.HwndGetWindow(msocWindow dwWhich, uint dwReserved) => HWND.Null;
System\Windows\Forms\Application.cs (6)
323HWND hwnd = PInvoke.FindWindow(s_systemTrackerWindow, s_systemTrackerWindow); 697private static unsafe BOOL SendThemeChanged(HWND hwnd) 722private static BOOL SendThemeChangedRecursive(HWND handle) 1131internal static unsafe ThreadContext GetContextForHandle<T>(T handle) where T : IHandle<HWND> 1194internal static void ParkHandle(HandleRef<HWND> handle, DPI_AWARENESS_CONTEXT dpiAwarenessContext) 1236internal static void UnparkHandle(IHandle<HWND> handle, DPI_AWARENESS_CONTEXT context)
System\Windows\Forms\Application.LightThreadContext.cs (4)
64if (!PInvokeCore.PeekMessage(&temp, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE)) 83if (PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE)) 91PInvoke.GetMessage(&msg, HWND.Null, 0, 0); 134if (!PInvokeCore.PeekMessage(&msg, HWND.Null, 0, 0, PEEK_MESSAGE_REMOVE_TYPE.PM_NOREMOVE))
System\Windows\Forms\Application.MarshallingControl.cs (1)
32cp.Parent = HWND.HWND_MESSAGE;
System\Windows\Forms\Application.ModalApplicationContext.cs (2)
30HWND parentHandle = (HWND)PInvokeCore.GetWindowLong(MainForm, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT);
System\Windows\Forms\Application.ParkingWindow.cs (5)
38cp.Parent = HWND.HWND_MESSAGE; 92HWND hwndChild = PInvoke.GetWindow(this, GET_WINDOW_CMD.GW_CHILD); 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 (4)
729HWND hwndOwner = default; 750hwndOwner = (HWND)PInvokeCore.GetWindowLong(CurrentForm, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 878msg.hwnd = (HWND)message.HWnd; 972HWND hwndRoot = PInvoke.GetAncestor(msg.hwnd, GET_ANCESTOR_FLAGS.GA_ROOT);
System\Windows\Forms\Application.ThreadWindows.cs (7)
15private readonly List<HWND> _windows; 16private HWND _activeHwnd; 17private HWND _focusedHwnd; 23_windows = new List<HWND>(16); 28private BOOL Callback(HWND hwnd) 47foreach (HWND hwnd in _windows) 66foreach (HWND hwnd in _windows)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ComponentEditor.cs (3)
51HWND handle = parent is null ? HWND.Null : (HWND)parent.Handle;
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyBuilderUITypeEditor.cs (2)
31HWND parentHandle = PInvoke.GetFocus(); 39parentHandle = (HWND)parent.Handle;
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (2)
28HWND parentHandle = PInvoke.GetFocus(); 79(HWND)parentHandle,
System\Windows\Forms\Control.cs (56)
48IHandle<HWND> 1290HWND focusHwnd = PInvoke.GetFocus(); 2207internal HWND HWNDInternal => _window.HWND; 2247HWND parentHandle = PInvoke.GetParent(this); 2248HWND lastParentHandle = parentHandle; 2318HWND prev; 2319HWND next; 2320HWND start = parent is not null ? parent.HWND : HWND; 2342internal HWND InternalHandle => !IsHandleCreated ? default : (HWND)Handle; 4389HWND.HWND_TOP, 5211HWND hwnd = (HWND)handle; 5230internal static HandleRef<HWND> GetHandleRef(HWND hwnd) => new(FromChildHandle(hwnd), hwnd); 5295HWND hwnd = PInvoke.ChildWindowFromPointEx(this, pt, (CWP_FLAGS)value); 5453for (HWND hWndChild = PInvoke.GetWindow(this, GET_WINDOW_CMD.GW_CHILD); 5455hWndChild = PInvoke.GetWindow(new HandleRef<HWND>(this, hWndChild), GET_WINDOW_CMD.GW_HWNDNEXT)) 5771internal static HandleRef<HWND> GetSafeHandle(IWin32Window window) 5780HWND hwnd = (HWND)window.Handle; 7973PInvokeCore.GetClientRect(new HandleRef<HWND>(_window, InternalHandle), out RECT rect); 8568PInvokeCore.MapWindowPoints((HWND)default, this, ref p); 8577PInvokeCore.MapWindowPoints(this, (HWND)default, ref p); 9229HWND parentHandle = PInvoke.GetParent(this); 9377PInvokeCore.MapWindowPoints(HWND.Null, this, ref rect); 9387PInvokeCore.MapWindowPoints(this, HWND.Null, ref rect); 9427internal virtual void ReleaseUiaProvider(HWND handle) 10039HWND.HWND_BOTTOM, 10180PInvoke.SetWindowPos(this, HWND.Null, x, y, width, height, flags); 10245private void SetParentHandle(HWND value) 10251HWND parentHandle = PInvoke.GetParent(this); 10308if (PInvoke.SetParent(this, HWND.Null).IsNull) 10441HWND.Null, 10502HWND.HWND_TOP, 10512static unsafe void PrepareDarkMode(HWND hwnd, bool darkModeEnabled) 10853PInvokeCore.MapWindowPoints(HWND.Null, PInvoke.GetParent(this), ref rect); 10944HWND hWnd = control.InternalHandle; 10983HWND parentHandle = PInvoke.GetParent(this); 11013HWND previous = HWND.HWND_TOP; 11093HWND.HWND_TOP, 11112internal void WindowAssignHandle(HWND handle, bool value) 11126HWND parentHandle = HWND; 11127HWND lastParentHandle = parentHandle; 11780HWND dialogItem = PInvoke.GetDlgItem(m.HWND, controlId); 11787dialogItem = (HWND)controlId; 11796HWND handle = NativeWindow.GetHandleFromWindowId((short)m.WParamInternal.LOWORD); 11965if ((HWND)m.WParamInternal == InternalHandle && m.LParamInternal.LOWORD == PInvoke.HTCLIENT) 12015HWND hWnd = HWND.Null; 12019hWnd = (HWND)m.LParamInternal; 12935HWND IHandle<HWND>.Handle => HWND; 12937internal HWND HWND => (HWND)Handle;
System\Windows\Forms\Control.Ime.cs (14)
268HWND focusHandle = PInvoke.GetFocus(); 698HIMC oldContext = PInvoke.ImmAssociateContext((HWND)handle, (HIMC)IntPtr.Zero); 712HIMC inputContext = PInvoke.ImmGetContext((HWND)handle); 722PInvoke.ImmAssociateContext((HWND)handle, inputContext); 727PInvoke.ImmAssociateContext((HWND)handle, s_originalImeContext); 732PInvoke.ImmReleaseContext((HWND)handle, inputContext); 760inputContext = PInvoke.ImmGetContext((HWND)handle); 810PInvoke.ImmReleaseContext((HWND)handle, inputContext); 821HIMC inputContext = PInvoke.ImmGetContext((HWND)handle); 828PInvoke.ImmReleaseContext((HWND)handle, inputContext); 905HIMC inputContext = PInvoke.ImmGetContext((HWND)handle); 915PInvoke.ImmReleaseContext((HWND)handle, inputContext); 932HIMC inputContext = PInvoke.ImmGetContext((HWND)handle); 941succeeded = PInvoke.ImmReleaseContext((HWND)handle, inputContext);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
61ScaleHelper.IsScalingRequirementMet ? Control.HWNDInternal : HWND.Null);
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (2)
91HWND hwnd) 126DrawButtonForHandle(g, bounds, focused, state, HWND.Null);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (5)
74HWND hwnd = default) 110CheckBoxState state) => DrawCheckBox(g, glyphLocation, textBounds, checkBoxText, font, flags, focused, state, HWND.Null); 121HWND hwnd) 232internal static Size GetGlyphSize(IDeviceContext deviceContext, CheckBoxState state, HWND hwnd = default) 243internal static Size GetGlyphSize(HDC hdc, CheckBoxState state, HWND hwnd)
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (9)
51DrawRadioButton(g, glyphLocation, state, HWND.Null); 57HWND hwnd) 68HWND hwnd) 113DrawRadioButton(g, glyphLocation, textBounds, radioButtonText, font, flags, focused, state, HWND.Null); 125HWND hwnd) 201HWND.Null); 214HWND hwnd) 254return GetGlyphSize(hdc, state, HWND.Null); 257internal static Size GetGlyphSize(HDC hdc, RadioButtonState state, HWND hwnd)
System\Windows\Forms\Controls\ComboBox\ComboBox.ACNativeWindow.cs (7)
16private static readonly Dictionary<HWND, ACNativeWindow?> s_acWindows = []; 18internal ACNativeWindow(HWND acHandle) 23PInvokeCore.EnumChildWindows(new HandleRef<HWND>(this, acHandle), RegisterACWindowRecursive); 26private static BOOL RegisterACWindowRecursive(HWND handle) 78internal static void RegisterACWindow(HWND acHandle, bool subclass) 107List<HWND> toRemove = []; 116foreach (HWND handle in toRemove)
System\Windows\Forms\Controls\ComboBox\ComboBox.AutoCompleteDropDownFinder.cs (1)
37private unsafe BOOL Callback(HWND hwnd)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildEditUiaProvider.cs (3)
22private readonly HWND _handle; 29public ComboBoxChildEditUiaProvider(ComboBox owner, HWND childEditControlhandle) : base(owner, childEditControlhandle) 88PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _handle), out IRawElementProviderSimple* provider);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildListUiaProvider.cs (3)
22private readonly HWND _childListControlhandle; 24public ComboBoxChildListUiaProvider(ComboBox owningComboBox, HWND childListControlhandle) : base(owningComboBox, childListControlhandle) 183PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _childListControlhandle), out IRawElementProviderSimple* provider);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxItemAccessibleObject.cs (1)
54PInvokeCore.MapWindowPoints(listHandle, HWND.Null, ref translated);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (3)
28private readonly IHandle<HWND> _owningChildEdit; 295PInvokeCore.MapWindowPoints(_owningChildEdit, (HWND)default, ref pt); 345if (PInvokeCore.MapWindowPoints((HWND)default, _owningChildEdit, ref clientLocation) == 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (9)
69private HWND _dropDownHandle; 527HWND focus = PInvoke.GetFocus(); 1974internal HandleRef<HWND> GetListHandle() 2285HWND hwnd = PInvoke.GetWindow(this, GET_WINDOW_CMD.GW_CHILD); 2295hwnd = PInvoke.GetWindow(new HandleRef<HWND>(this, hwnd), GET_WINDOW_CMD.GW_HWNDNEXT); 2376_dropDownHandle = HWND.Null; 3064internal override void ReleaseUiaProvider(HWND handle) 3364HWND.HWND_TOP, 3469_dropDownHandle = (HWND)m.LParamInternal;
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (2)
109DrawDropDownButtonForHandle(hdc, bounds, state, HWND.Null); 119internal static void DrawDropDownButtonForHandle(HDC hdc, Rectangle bounds, ComboBoxState state, HWND hwnd)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
25599internal override void ReleaseUiaProvider(HWND handle) 25624_editingPanel?.ReleaseUiaProvider(HWND.Null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
2430EditingComboBox?.ReleaseUiaProvider(HWND.Null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (1)
128internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (1)
287internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (2)
1505HWND handle = (HWND)PInvokeCore.SendMessage(this, PInvoke.DTM_GETMONTHCAL);
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.EnumChildren.cs (2)
10public HWND hwndFound; 12public BOOL enumChildren(HWND hwnd)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
428internal override void ReleaseUiaProvider(HWND handle) 1750if ((HWND)m.WParamInternal == InternalHandle && m.LParamInternal.LOWORD == PInvoke.HTCLIENT)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
2039internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
171UIA_PROPERTY_ID.UIA_NativeWindowHandlePropertyId => UIAHelper.WindowHandleToVariant(HWND.Null),
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (2)
395HWND hwndHdr = (HWND)PInvokeCore.SendMessage(ListView, PInvoke.LVM_GETHEADER);
System\Windows\Forms\Controls\ListView\ListView.cs (13)
2189HWND hwnd = (HWND)PInvokeCore.SendMessage(this, PInvoke.LVM_GETHEADER); 3799HWND header = (HWND)PInvokeCore.SendMessage(this, PInvoke.LVM_GETHEADER); 3802PInvoke.InvalidateRect(new HandleRef<HWND>(this, header), lpRect: null, bErase: true); 4701HWND columnHeaderHandle = (HWND)PInvokeCore.SendMessage( 4947HWND headerWindow = PInvoke.GetWindow(this, GET_WINDOW_CMD.GW_CHILD); 5096internal override void ReleaseUiaProvider(HWND handle) 5431HWND oldHandle = (HWND)PInvokeCore.SendMessage(this, PInvoke.LVM_SETTOOLTIPS, toolTip); 6386HWND hwndHdr = (HWND)PInvokeCore.SendMessage(this, PInvoke.LVM_GETHEADER);
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
189UIA_PROPERTY_ID.UIA_NativeWindowHandlePropertyId => UIAHelper.WindowHandleToVariant(HWND.Null),
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
194return UIAHelper.WindowHandleToVariant(HWND.Null);
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
240HWND ancestor = PInvoke.GetAncestor(this, GET_ANCESTOR_FLAGS.GA_ROOT);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1483internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (5)
1854internal override void ReleaseUiaProvider(HWND handle) 1864_helpPane?.ReleaseUiaProvider(HWND.Null); 1865_commandsPane?.ReleaseUiaProvider(HWND.Null); 1866_toolStrip?.ReleaseUiaProvider(HWND.Null); 3338HWND hWndParent = PInvoke.GetParent(this);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (1)
98ScaleHelper.IsScalingRequirementMet ? HWNDInternal : HWND.Null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (2)
1658void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd) 1702HWND hwnd)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.GridEntryAccessibleObject.cs (3)
201/// they don't have windows - we use <see cref="HWND" /> of <see cref="PropertyGridView" />. 210? (int)(owner?.OwnerGridView?.InternalHandle ?? HWND.Null) 211: (int)HWND.Null,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (1)
127HWND.HWND_TOPMOST,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (11)
2539for (HWND hwnd = PInvokeCore.GetForegroundWindow(); !hwnd.IsNull; hwnd = PInvoke.GetParent(hwnd)) 4760internal override void ReleaseUiaProvider(HWND handle) 4770_scrollBar?.ReleaseUiaProvider(HWND.Null); 4771_listBox?.ReleaseUiaProvider(HWND.Null); 4772_dropDownHolder?.ReleaseUiaProvider(HWND.Null); 4773_editTextBox?.ReleaseUiaProvider(HWND.Null); 4774_dropDownButton?.ReleaseUiaProvider(HWND.Null); 4775_dialogButton?.ReleaseUiaProvider(HWND.Null); 4880HWND priorFocus = PInvoke.GetFocus(); 4915HWND.Null, 4988HWND.Null,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (4)
264private bool OwnsWindow(HWND hWnd) 268hWnd = (HWND)PInvokeCore.GetWindowLong(hWnd, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 667HWND activatedWindow = (HWND)m.LParamInternal;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (1)
152private bool ProcessMouseDown(HWND hwnd)
System\Windows\Forms\Controls\TabControl\TabControl.cs (4)
1260HWND tooltipHwnd = (HWND)PInvokeCore.SendMessage(this, PInvoke.TCM_GETTOOLTIPS); 1265HWND.HWND_TOPMOST, 1797private BOOL StyleChildren(HWND handle) =>
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
653internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
110if (PInvokeCore.MapWindowPoints((HWND)default, Owner, ref clientLocation) == 0)
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (2)
163HWND rootHwnd = PInvoke.GetAncestor(this, GET_ANCESTOR_FLAGS.GA_ROOT); 572HWND rootHwnd = PInvoke.GetAncestor(this, GET_ANCESTOR_FLAGS.GA_ROOT);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (9)
35private HWND _hwndThatLostFocus; 3918internal override void ReleaseUiaProvider(HWND handle) 4405private void SnapFocus(HWND otherHwnd) 4434HWND thisHwndRoot = PInvoke.GetAncestor(this, GET_ANCESTOR_FLAGS.GA_ROOT); 4435HWND otherHwndRoot = PInvoke.GetAncestor(otherHwnd, GET_ANCESTOR_FLAGS.GA_ROOT); 4586SnapFocus((HWND)(nint)m.WParamInternal); 4598HWND hwndClicked = PInvoke.ChildWindowFromPointEx( 4613HWND rootHwnd = PInvoke.GetAncestor(this, GET_ANCESTOR_FLAGS.GA_ROOT); 4617HWND hwndActive = PInvoke.GetActiveWindow();
System\Windows\Forms\Controls\ToolStrips\ToolStrip.RestoreFocusMessageFilter.cs (1)
39HWND rootHwnd = PInvoke.GetAncestor(_ownerToolStrip, GET_ANCESTOR_FLAGS.GA_ROOT);
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
855_control?.ReleaseUiaProvider(HWND.Null);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (6)
893topMost ? HWND.HWND_TOPMOST : HWND.HWND_NOTOPMOST, 1581HWND foregroundWindow = PInvokeCore.GetForegroundWindow(); 1624HWND.HWND_TOP, 1916Debug.Fail($"Why are we being activated when we're not visible? Deactivating thing is {WindowsFormsUtils.GetControlInformation((HWND)(nint)m.LParamInternal)}"); 1982HandleRef<HWND> activeWindow = ToolStripManager.ModalMenuFilter.ActiveHwnd;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
640_dropDown?.ReleaseUiaProvider(HWND.Null);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (4)
831HWND rootWindowOfToolStrip = PInvoke.GetAncestor(topMostToolStrip, GET_ANCESTOR_FLAGS.GA_ROOT); 832HWND rootWindowOfControl = PInvoke.GetAncestor(activeControl, GET_ANCESTOR_FLAGS.GA_ROOT); 932HWND topmostParentOfMenu = PInvoke.GetAncestor(menuStripToActivate, GET_ANCESTOR_FLAGS.GA_ROOT); 933HWND foregroundWindow = PInvokeCore.GetForegroundWindow();
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (15)
31private HandleRef<HWND> _activeHwnd; 33private HandleRef<HWND> _lastActiveWindow; 60internal static HandleRef<HWND> ActiveHwnd => Instance.ActiveHwndInternal; 76private HandleRef<HWND> ActiveHwndInternal 138HWND hwndActive = PInvoke.GetActiveWindow(); 210PInvoke.ShowCaret(HWND.Null); 321private void ProcessMouseButtonPressed(HWND hwndMouseMessageIsFrom, Point location) 411HWND hwndActive = PInvoke.GetActiveWindow(); 470PInvoke.HideCaret(HWND.Null); 496private static bool IsChildOrSameWindow<T>(in T hwndParent, in T hwndChild) where T : IHandle<HWND> 536HandleRef<HWND> activeToolStripHandle = new(activeToolStrip); 580if (!IsChildOrSameWindow<IHandle<HWND>>(activeToolStripHandle, m)) 585if (toplevelToolStrip is not null && IsChildOrSameWindow<IHandle<HWND>>(toplevelToolStrip, m)) 594else if (!IsChildOrSameWindow<IHandle<HWND>>(ActiveHwnd, m)) 648internal static DPI_AWARENESS_CONTEXT GetDpiAwarenessContextForWindow(HWND hwnd)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
37private HandleRef<HWND> _targetWindowHandle;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
54HWND.Null,
System\Windows\Forms\Controls\TrackBar\TrackBar.TrackBarChildAccessibleObject.cs (1)
61(int)(this.TryGetOwnerAs(out TrackBar? owner) ? owner.InternalHandle : HWND.Null),
System\Windows\Forms\Controls\TreeView\TreeView.cs (5)
175internal override void ReleaseUiaProvider(HWND handle) 1940HWND.HWND_TOP, 1953HWND.HWND_TOP, 2919HWND tooltipHandle = nmhdr->hwndFrom; 2935HWND.HWND_TOPMOST,
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
454internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (1)
338internal override void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1104HWND hwndFocus = PInvoke.GetFocus();
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (5)
333hwnd = HWND.Null, 425HWND hwndInPlaceObject = HWND.Null; 428Application.ParkHandle(new HandleRef<HWND>(AXInPlaceObject, hwndInPlaceObject), DpiAwarenessContext); 775internal void AttachWindow(HWND hwnd)
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (4)
69HRESULT IOleInPlaceFrame.Interface.GetWindow(HWND* phwnd) 145HRESULT IOleInPlaceFrame.Interface.SetMenu(HMENU hmenuShared, nint holemenu, HWND hwndActiveObject) 417HRESULT IOleInPlaceUIWindow.Interface.GetWindow(HWND* phwnd) 435HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd)
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (7)
187HWND hwnd = HWND.Null; 214unsafe HRESULT IOleInPlaceSite.Interface.GetWindow(HWND* phwnd) 271lpFrameInfo->hwndFrame = Host.ParentInternal is { } parent ? parent.HWND : HWND.Null; 310HWND hWnd, 318HWND hWnd, 421HRESULT IOleWindow.Interface.GetWindow(HWND* phwnd)
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (2)
174hwndOwner = (HWND)hwndOwner, 175hInstance = (HWND)Instance,
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (14)
22private HWND _defaultControlHwnd; 24private readonly unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> _functionPointer; 33_functionPointer = (delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint>)(void*)Marshal.GetFunctionPointerForDelegate(_hookProc); 54internal LRESULT HookProcInternal(HWND hWnd, uint msg, WPARAM wparam, LPARAM lparam) 57private protected unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> HookProcFunctionPointer 68MoveToScreenCenter((HWND)hWnd); 72_defaultControlHwnd = (HWND)wparam; 73PInvoke.SetFocus((HWND)wparam); 77PInvokeCore.PostMessage((HWND)hWnd, CDM_SETDEFAULTFOCUS); 95private protected static void MoveToScreenCenter(HWND hwnd) 103HWND.HWND_TOP, 117private LRESULT OwnerWndProcInternal(HWND hWnd, uint msg, WPARAM wparam, LPARAM lparam) 146return PInvokeCore.CallWindowProc((void*)_priorWindowProcedure, (HWND)hWnd, (uint)msg, (nuint)wparam, lparam); 193HandleRef<HWND> ownerHwnd = default;
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (8)
35private HWND _dialogHWnd; 499_dialogHWnd = PInvoke.GetParent((HWND)hWnd); 549PInvokeCore.SetWindowLong((HWND)hWnd, 0, -1); 556PInvokeCore.SetWindowLong((HWND)hWnd, 0, -1); 671HWND focusHandle = PInvoke.GetFocus(); 734if (UseVistaDialogInternal && TryRunDialogVista((HWND)hWndOwner, out bool returnValue)) 739return RunDialogOld((HWND)hWndOwner); 742private unsafe bool RunDialogOld(HWND owner)
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (1)
23private unsafe bool TryRunDialogVista(HWND hWndOwner, out bool returnValue)
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (5)
279UseVistaDialogInternal && TryRunDialogVista((HWND)hwndOwner, out bool returnValue) 281: RunDialogOld((HWND)hwndOwner); 283private unsafe bool TryRunDialogVista(HWND owner, out bool returnValue) 436private unsafe bool RunDialogOld(HWND owner) 488private static unsafe int FolderBrowserDialog_BrowseCallbackProc(HWND hwnd, uint msg, LPARAM lParam, LPARAM lpData)
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (7)
313PInvokeCore.SendMessage((HWND)hWnd, PInvokeCore.WM_CHOOSEFONT_GETLOGFONT, (WPARAM)0, ref logFont); 315int index = (int)PInvoke.SendDlgItemMessage((HWND)hWnd, (int)PInvoke.cmb4, PInvoke.CB_GETCURSEL, 0, 0); 319(HWND)hWnd, 346HWND hWndCtl = PInvoke.GetDlgItem((HWND)hWnd, (int)PInvoke.cmb4); 348hWndCtl = PInvoke.GetDlgItem((HWND)hWnd, (int)PInvoke.stc4); 389hwndOwner = (HWND)hWndOwner,
System\Windows\Forms\Dialogs\MessageBox.cs (1)
456HandleRef<HWND> handle = default;
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (6)
87private HWND _handle; 271HWND hwnd, 669_handle = HWND.Null; 913HWND hWnd, 1016_handle = HWND.Null; 1452hwndParent = (HWND)hwndOwner,
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.WindowSubclassHandler.cs (1)
13: base((HWND)taskDialog.OrThrowIfNull().Handle)
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (1)
90=> UIAHelper.WindowHandleToVariant(_window?.Handle ?? HWND.Null),
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (3)
128HWND.HWND_TOP, 157HWND.HWND_TOP, 386HWND.HWND_TOP,
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.ErrorWindowAccessibleObject.cs (1)
83PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _owner.HWND), out IRawElementProviderSimple* provider);
System\Windows\Forms\Form.cs (17)
1366HWND.HWND_TOP, 2004private IHandle<HWND> TaskbarOwner 2068value ? HWND.HWND_TOPMOST : HWND.HWND_NOTOPMOST, 3736HandleRef<HWND> ownerHandle = dialogOwner is not null 3927HWND ownerHandle = (HWND)PInvokeCore.GetWindowLong(this, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 3979HWND hWndOwner = default; 3982hWndOwner = (HWND)PInvokeCore.GetWindowLong(this, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 5497HWND activeHwnd = PInvoke.GetActiveWindow(); 5498HandleRef<HWND> ownerHwnd = owner is null ? GetHandleRef(activeHwnd) : GetSafeHandle(owner); 5702HWND captureHwnd = PInvoke.GetCapture(); 5709HWND activeHwnd = PInvoke.GetActiveWindow(); 5710HandleRef<HWND> ownerHwnd = owner is null ? GetHandleRef(activeHwnd) : GetSafeHandle(owner); 6107IHandle<HWND> ownerHwnd = NullHandle<HWND>.Instance; 6931if (HWND == (HWND)m.WParamInternal)
System\Windows\Forms\Form.EnumThreadWindowsCallback.cs (8)
14private List<HWND>? _ownedWindows; 16private readonly HWND _formHandle; 18internal EnumThreadWindowsCallback(HWND formHandle) 23internal BOOL Callback(HWND hwnd) 25HWND parent = (HWND)PInvokeCore.GetWindowLong(hwnd, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 42foreach (HWND hwnd in _ownedWindows) 55foreach (HWND hwnd in _ownedWindows)
System\Windows\Forms\Help\Help.cs (3)
137HandleRef<HWND> handle = parent is not null ? (new(parent)) : Control.GetHandleRef(PInvoke.GetActiveWindow()); 163PInvoke.HtmlHelp(HWND.Null, pathAndFileName, HH_DISPLAY_TOPIC, null); 214HandleRef<HWND> handle = parent is not null ? new(parent) : Control.GetHandleRef(PInvoke.GetActiveWindow());
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
153internal static string GetControlInformation(HWND hwnd)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (2)
628HWND focusHandle = PInvoke.GetFocus(); 1411HWND.HWND_TOP,
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
2270if ((HWND)m.WParamInternal == InternalHandle && m.LParamInternal.LOWORD == PInvoke.HTCLIENT)
System\Windows\Forms\NativeWindow.cs (26)
14public unsafe partial class NativeWindow : MarshalByRefObject, IWin32Window, IHandle<HWND> 38private static readonly Dictionary<HWND, GCHandle> s_windowHandles = []; 39private static readonly Dictionary<short, HWND> s_windowIds = []; 90HWND handle; 153internal HWND HWND { get; private set; } 155HWND IHandle<HWND>.Handle => HWND; 236private static void AddWindowToTable(HWND handle, NativeWindow window) 278internal static short CreateWindowId(IHandle<HWND> handle) 292public void AssignHandle(IntPtr handle) => AssignHandle((HWND)handle, assignUniqueID: true); 294internal unsafe void AssignHandle(HWND hwnd, bool assignUniqueID) 340private LRESULT Callback(HWND hWnd, uint msg, WPARAM wparam, LPARAM lparam) 414HWND createResult = HWND.Null; 448(HWND)cp.Parent, 541HWND = HWND.Null; 555=> handle != IntPtr.Zero ? GetWindowFromTable((HWND)handle) : null; 560private static NativeWindow? GetWindowFromTable(HWND handle) => 569internal static HWND GetHandleFromWindowId(short id) 571if (!s_windowIds.TryGetValue(id, out HWND handle)) 573handle = HWND.Null; 613foreach ((HWND handle, GCHandle gcHandle) in s_windowHandles) 615if (!handle.IsNull && handle != (HWND)(-1)) 626w?.HWND = HWND.Null; 688HWND = HWND.Null; 702private static void RemoveWindowFromDictionary(HWND hwnd, NativeWindow window)
System\Windows\Forms\NativeWindow.WindowClass.cs (2)
42public LRESULT Callback(HWND hwnd, uint msg, WPARAM wparam, LPARAM lparam) 158windowClass.lpfnWndProc = (delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)callback;
System\Windows\Forms\OLE\DropSource.cs (3)
16private HWND _lastHwndTarget; 84void UpdateDragImage(GiveFeedbackEventArgs e, IComVisibleDataObject? dataObject, HWND lastHwndTarget) 100public unsafe HRESULT DragEnterTarget(HWND hwndTarget)
System\Windows\Forms\OLE\DropTarget.cs (1)
18private readonly HWND _hwndTarget;
System\Windows\Forms\Printing\PageSetupDialog.cs (1)
275hwndOwner = (HWND)hwndOwner,
System\Windows\Forms\Printing\PrintDialog.cs (4)
220UseEXDialog ? ShowPrintDialogEx((HWND)hwndOwner) : ShowPrintDialog((HWND)hwndOwner); 222private unsafe bool ShowPrintDialog(HWND hwndOwner) 348private unsafe bool ShowPrintDialogEx(HWND hwndOwner)
System\Windows\Forms\Printing\PrinterSettingsExtensions.cs (2)
26modeSize = PInvoke.DocumentProperties(HWND.Null, HANDLE.Null, n, null, (DEVMODEW*)null, 0); 39HWND.Null,
System\Windows\Forms\Rendering\ControlPaint.cs (1)
307using GetDcScope screenDC = new(HWND.Null);
System\Windows\Forms\Screen.cs (1)
277? new Screen(PInvokeCore.MonitorFromWindow((HWND)hwnd, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST))
System\Windows\Forms\SendKeys\SendKeys.cs (5)
129HWND hwnd, 182private static void AddMsgsForVK(int vk, int repeat, bool altnoctrldown, HWND hwnd) 195private static void CancelMods(ref (int HaveShift, int HaveCtrl, int HaveAlt) haveKeys, int level, HWND hwnd) 379private static void ParseKeys(string keys, HWND hwnd) 923ParseKeys(keys, (control is not null) ? (HWND)control.Handle : default);
System\Windows\Forms\SendKeys\SendKeys.SKEvent.cs (3)
16public readonly HWND HWND; 18public SKEvent(MessageId wm, uint paramL, bool paramH, HWND hwnd) 26public SKEvent(MessageId wm, uint paramL, uint paramH, HWND hwnd)
System\Windows\Forms\StringSource.cs (1)
40public bool Bind(IHandle<HWND> edit, AUTOCOMPLETEOPTIONS options)
System\Windows\Forms\Timer.cs (3)
224Parent = HWND.HWND_MESSAGE 237private static bool GetInvokeRequired(HWND hwnd) 273public void StopTimer(HWND hwnd, bool destroyHwnd)
System\Windows\Forms\ToolTip\ToolTip.cs (29)
17public partial class ToolTip : Component, IExtenderProvider, IHandle<HWND> 50private readonly Dictionary<HWND, Control> _owners = []; 257HWND IHandle<HWND>.Handle => HWND; 259internal HWND HWND => (HWND)Handle; 308HWND hwnd = PInvoke.GetActiveWindow(); 309HWND rootHwnd = PInvoke.GetAncestor(control, GET_ANCESTOR_FLAGS.GA_ROOT); 987private ToolInfoWrapper<HandleRef<HWND>> GetWinTOOLINFO(IWin32Window window) 1028private HWND GetWindowFromPoint(Point screenCoords, ref bool success) 1036HWND hwndControl = PInvoke.WindowFromPoint(screenCoords); 1047return HWND.Null; 1050HWND baseHwnd = current?.HWND ?? HWND.Null; 1051HWND hwnd = HWND.Null; 1061HWND found = PInvoke.ChildWindowFromPointEx(baseHwnd, pt, CWP_FLAGS.CWP_SKIPINVISIBLE); 1104hwnd = HWND.Null; 1527HWND hwnd = GetCurrentToolHwnd(); 1532ToolInfoWrapper<HandleRef<HWND>> info = new(Control.GetSafeHandle(ownerWindow)); 1737ToolInfoWrapper<HandleRef<HWND>> info = new(Control.GetSafeHandle(win)); 1747_owners.Remove((HWND)win.Handle); 1757_owners.Remove((HWND)win.Handle); 1951HWND.HWND_TOPMOST, 1959private HWND GetCurrentToolHwnd() 1972HWND hwnd = GetCurrentToolHwnd(); 2098HWND.HWND_TOPMOST, 2109HWND.HWND_TOPMOST, 2248_owners.Remove((HWND)window.Handle);
System\Windows\Forms\UserControl.cs (1)
248HWND hwndFocus = PInvoke.GetFocus();
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (10)
106using PInvoke.OpenThemeDataScope handle = new(HWND.Null, className); 216DrawBackground(hdc, bounds, HWND.Null); 219internal unsafe void DrawBackground(HDC dc, Rectangle bounds, HWND hwnd = default) 245DrawBackground(hdc, bounds, clipRectangle, HWND.Null); 248internal unsafe void DrawBackground(HDC dc, Rectangle bounds, Rectangle clipRectangle, HWND hwnd) 576return GetPartSize(hdc, type, HWND.Null); 579internal unsafe Size GetPartSize(HDC dc, ThemeSizeType type, HWND hwnd = default) 865private static PInvoke.OpenThemeDataScope OpenThemeData(HWND hwnd, string classList) 883return Create(className, throwExceptionOnFail, HWND.Null); 886internal static ThemeHandle? Create(string className, bool throwExceptionOnFail, HWND hWndRef)
System\Windows\Forms\WindowSubclassHandler.cs (3)
26private readonly HWND _handle; 61public unsafe WindowSubclassHandler(HWND hwnd) 263HWND hWnd,
System.Windows.Forms.Design (86)
System\ComponentModel\Design\CollectionEditor.FilterListBox.cs (1)
96HWND hwnd = PInvoke.GetFocus();
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
80using (GetDcScope hdc = new((HWND)listBox.Handle))
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (5)
106private bool OwnsWindow(HWND hWnd) 110hWnd = (HWND)PInvokeCore.GetWindowLong(hWnd, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 116if (hWnd == (HWND)Handle) 144HWND hWndCapture = PInvoke.GetCapture(); 173&& !OwnsWindow((HWND)m.LParamInternal))
System\ComponentModel\Design\DesignerActionUI.cs (2)
723new HandleRef<HWND>(_mainParentWindow, (HWND)_mainParentWindow.Handle));
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (14)
56HWND focusedControl = PInvoke.GetFocus(); 89HWND hwndActivating = PInvoke.GetActiveWindow(); 94else if (WindowOwnsWindow((HWND)Handle, hwndActivating)) 99else if (_mainParentWindow is not null && !WindowOwnsWindow((HWND)_mainParentWindow.Handle, hwndActivating)) 116HWND parent = (HWND)PInvokeCore.GetWindowLong( 117new HandleRef<HWND>(this, hwndActivating), 194private static bool WindowOwnsWindow(HWND hWndOwner, HWND hWndDescendant) 203hWndDescendant = (HWND)PInvokeCore.GetWindowLong(hWndDescendant, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT); 228HWND hwndActivating = (HWND)m.LParamInternal; 229_cancelClose = WindowOwnsWindow((HWND)Handle, hwndActivating); 258HWND focusedControlPtr = PInvoke.GetFocus();
System\ComponentModel\Design\ObjectSelectorEditor.cs (2)
67HWND hwnd = (HWND)treeView.Handle;
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
242HWND hwndFocus = PInvoke.GetFocus();
System\Drawing\Design\ColorEditor.CustomColorDialog.cs (16)
65(HWND)hwnd, 71(HWND)hwnd, 77(HWND)hwnd, 83(HWND)hwnd, 89(HWND)hwnd, 95(HWND)hwnd, 100HWND hwndCtl = PInvoke.GetDlgItem((HWND)hwnd, (int)PInvoke.COLOR_MIX); 104HWND.HWND_TOP, 107hwndCtl = PInvoke.GetDlgItem((HWND)hwnd, (int)MESSAGEBOX_RESULT.IDOK); 111HWND.HWND_TOP, 121byte red = (byte)PInvoke.GetDlgItemInt((HWND)hwnd, (int)PInvoke.COLOR_RED, &success, false); 124byte green = (byte)PInvoke.GetDlgItemInt((HWND)hwnd, (int)PInvoke.COLOR_GREEN, &success, false); 127byte blue = (byte)PInvoke.GetDlgItemInt((HWND)hwnd, (int)PInvoke.COLOR_BLUE, &success, false); 132(HWND)hwnd, 135(LPARAM)PInvoke.GetDlgItem((HWND)hwnd, (int)MESSAGEBOX_RESULT.IDOK));
System\Drawing\Design\FontEditor.cs (1)
38HWND hwndFocus = PInvoke.GetFocus();
System\Drawing\Design\IconEditor.cs (1)
73HWND hwndFocus = PInvoke.GetFocus();
System\Drawing\Design\ImageEditor.cs (1)
102HWND hwndFocus = PInvoke.GetFocus();
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (1)
145private bool ProcessMouseMessage(HWND hwnd, MessageId msg, int x, int y)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (4)
287PInvokeCore.MapWindowPoints((HWND)handle, _adornerWindow, ref pt); 458PInvoke.SetActiveWindow(new HandleRef<HWND>(hWnd, (HWND)hWnd.Handle)); 707hwndTrack = (HWND)_adornerWindow.Handle,
System\Windows\Forms\Design\CommandSet.cs (1)
690HWND hwnd = PInvoke.WindowFromPoint(p);
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
45_designer.HookChildHandles((HWND)(nint)m.LParamInternal); // they will get removed from the collection just above
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (3)
12private HWND _handle = HWND.Null; 32_handle = (HWND)newHandle;
System\Windows\Forms\Design\ControlDesigner.cs (6)
896HookChildHandles((HWND)child.Handle); 918HookChildHandles((HWND)child.Handle); 1794PInvokeCore.MapWindowPoints(m, (HWND)default, ref location); 2403internal void HookChildHandles(HWND firstChild) 2405HWND hwndChild = firstChild; 2444private static bool IsWindowInCurrentProcess(HWND hwnd)
System\Windows\Forms\Design\DesignerFrame.cs (2)
409HWND.HWND_TOP, 518HWND.HWND_TOP,
System\Windows\Forms\Design\DesignerUtils.cs (6)
388using GetDcScope controlDC = new((HWND)control.Handle); 821private static uint TreeView_GetExtendedStyle(HWND handle) 834HWND hwnd = (HWND)treeView.Handle; 849HWND hwnd = (HWND)listView.Handle;
System\Windows\Forms\Design\FolderNameEditor.FolderBrowser.cs (1)
63owner is not null ? (HWND)owner.Handle : PInvoke.GetActiveWindow(),
System\Windows\Forms\Design\ImageListImageEditor.cs (1)
67HWND hwndFocus = PInvoke.GetFocus();
System\Windows\Forms\Design\ListViewDesigner.cs (6)
64HookChildHandles((HWND)Control.Handle); 77HWND hwndHit = PInvoke.ChildWindowFromPointEx(listView, listViewPoint, CWP_FLAGS.CWP_SKIPINVISIBLE); 81HWND headerHwnd = (HWND)PInvokeCore.SendMessage(listView, PInvoke.LVM_GETHEADER); 84PInvokeCore.MapWindowPoints(HWND.Null, headerHwnd, ref point); 108HookChildHandles((HWND)Control.Handle);
System\Windows\Forms\Design\OleDragDropHandler.cs (4)
381DrawReversibleFrame((HWND)parentControl.Handle, newRect, backColor); 402DrawReversibleFrame((HWND)parentControl.Handle, newRect, backColor); 410private static void DrawReversibleFrame(HWND handle, Rectangle rectangle, Color backColor) 491while (PInvokeCore.PeekMessage(&msg, HWND.Null, PInvokeCore.WM_PAINT, PInvokeCore.WM_PAINT, PEEK_MESSAGE_REMOVE_TYPE.PM_REMOVE))
System\Windows\Forms\Design\PbrsForward.cs (2)
92HWND hwnd; 95: (HWND)supportInSituService.GetEditWindow();
System\Windows\Forms\Design\RichTextBoxDesigner.cs (1)
33PInvokeCore.RevokeDragDrop((HWND)control.Handle);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1560HWND focusedWindow = (HWND)m.WParamInternal;
System.Windows.Forms.IntegrationTests.Common (4)
GlobalUsings.cs (1)
4global using HWND = Windows.Win32.Foundation.HWND;
TestHelpers.cs (3)
436HWND mainWindowHandle = (HWND)process.MainWindowHandle; 443HWND foregroundWindow = PInvokeCore.GetForegroundWindow();
System.Windows.Forms.Interop.Tests (5)
RichTextBoxTests.cs (5)
22Assert.Equal((HWND)(nint)765, value.nmhdr.hwndFrom); 37Assert.Equal((HWND)(nint)765, value.nmhdr.hwndFrom); 52Assert.Equal((HWND)(nint)765, value.nmhdr.hwndFrom); 133Assert.Equal((HWND)(nint)765, value.nmhdr.hwndFrom); 147Assert.Equal((HWND)(nint)765, value.nmhdr.hwndFrom);
System.Windows.Forms.Primitives (178)
Microsoft\Office\IMsoComponent.cs (6)
45internal delegate* unmanaged[Stdcall]<IMsoComponent*, msocWindow, uint, HWND> HwndGetWindow_14; 99private static HWND HwndGetWindow(IMsoComponent* @this, msocWindow dwWhich, uint dwReserved) 100=> UnwrapAndInvoke<IMsoComponent, Interface, HWND>(@this, o => o.HwndGetWindow(dwWhich, dwReserved)); 219public HWND HwndGetWindow(msocWindow dwWhich, uint dwReserved) 222return ((delegate* unmanaged[Stdcall]<IMsoComponent*, msocWindow, uint, HWND>)_lpVtbl[13])(pThis, dwWhich, dwReserved); 498HWND HwndGetWindow(
Microsoft\VisualStudio\Shell\IProvidePropertyBuilder.cs (4)
74HWND hwndBldrOwner, 79return ((delegate* unmanaged[Stdcall]<IProvidePropertyBuilder*, int, BSTR*, IDispatch*, HWND, VARIANT*, VARIANT_BOOL*, HRESULT>)_lpVtbl[4])( 92/// browser and are invoked through <see cref="ExecuteBuilder(int, BSTR*, IDispatch*, HWND, VARIANT*, VARIANT_BOOL*)"/> 141HWND hwndBldrOwner,
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\IExtender.cs (3)
76internal delegate* unmanaged[Stdcall]<IExtender*, HWND*, HRESULT> get_Hwnd_22; 201private static HRESULT get_Hwnd(IExtender* @this, HWND* value) 237HWND Hwnd { get; }
System\Windows\Forms\Internals\MessageDecoder.cs (1)
19private static string ToString(HWND hwnd, MessageId messageId, WPARAM wparam, LPARAM lparam, LRESULT result)
System\Windows\Forms\Message.cs (7)
11public struct Message : IEquatable<Message>, IHandle<HWND> 25internal readonly HWND HWND => (HWND)HWnd; 82readonly HWND IHandle<HWND>.Handle => HWND; 94internal static Message Create(HWND hWnd, uint msg, WPARAM wparam, LPARAM lparam) 97internal static Message Create(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
Windows\Win32\PInvoke.ChildWindowFromPointEx.cs (4)
10/// <inheritdoc cref="ChildWindowFromPointEx(HWND, Point, CWP_FLAGS)"/> 11public static HWND ChildWindowFromPointEx<T>(T hwndParent, Point pt, CWP_FLAGS uFlags) 12where T : IHandle<HWND> 14HWND result = ChildWindowFromPointEx(hwndParent.Handle, pt, uFlags);
Windows\Win32\PInvoke.ClientToScreen.cs (2)
10/// <inheritdoc cref="ClientToScreen(HWND, ref Point)"/> 12where T : IHandle<HWND>
Windows\Win32\PInvoke.CreateWindowEx.cs (3)
11/// <inheritdoc cref="CreateWindowEx(WINDOW_EX_STYLE, string, string, WINDOW_STYLE, int, int, int, int, HWND, HMENU, HINSTANCE, void*)"/> 12public static unsafe HWND CreateWindowEx( 21HWND hWndParent,
Windows\Win32\PInvoke.DrawMenuBar.cs (2)
8/// <inheritdoc cref="DrawMenuBar(HWND)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.EnableScrollBar.cs (2)
8/// <inheritdoc cref="EnableScrollBar(HWND, uint, ENABLE_SCROLL_BAR_ARROWS)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.EnableWindow.cs (2)
8/// <inheritdoc cref="EnableWindow(HWND, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.EndDialog.cs (2)
8/// <inheritdoc cref="EndDialog(HWND, nint)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetAncestor.cs (4)
8/// <inheritdoc cref="GetAncestor(HWND, GET_ANCESTOR_FLAGS)"/> 9public static HWND GetAncestor<T>(T hwnd, GET_ANCESTOR_FLAGS flags) where T : IHandle<HWND> 11HWND result = GetAncestor(hwnd.Handle, flags);
Windows\Win32\PInvoke.GetDlgItem.cs (4)
8/// <inheritdoc cref="GetDlgItem(HWND, int)"/> 9public static HWND GetDlgItem<T>(T hDlg, int nIDDlgItem) 10where T : IHandle<HWND> 12HWND result = GetDlgItem(hDlg.Handle, nIDDlgItem);
Windows\Win32\PInvoke.GetDpiForWindow.cs (2)
8/// <inheritdoc cref="GetDpiForWindow(HWND)"/> 9public static uint GetDpiForWindow<T>(T hwnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetMenu.cs (2)
8/// <inheritdoc cref="GetMenu(HWND)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetParent.cs (4)
8/// <inheritdoc cref="GetParent(HWND)"/> 9public static HWND GetParent<T>(T hwnd) where T : IHandle<HWND> 11HWND result = GetParent(hwnd.Handle);
Windows\Win32\PInvoke.GetScrollInfo.cs (2)
8/// <inheritdoc cref="GetScrollInfo(HWND, SCROLLBAR_CONSTANTS, ref SCROLLINFO)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.GetSystemMenu.cs (2)
8/// <inheritdoc cref="GetSystemMenu(HWND, BOOL)"/> 9public static HMENU GetSystemMenu<T>(T hwnd, BOOL bRevert) where T : IHandle<HWND>
Windows\Win32\PInvoke.GetWindow.cs (4)
8/// <inheritdoc cref="GetWindow(HWND, GET_WINDOW_CMD)"/> 9public static HWND GetWindow<T>(T hWnd, GET_WINDOW_CMD uCmd) where T : IHandle<HWND> 11HWND result = GetWindow(hWnd.Handle, uCmd);
Windows\Win32\PInvoke.HtmlHelp.cs (12)
10/// <inheritdoc cref="HtmlHelp(HWND, string, HTML_HELP_COMMAND, nuint)" /> 11internal static unsafe HWND HtmlHelp<T>(T hwndCaller, string? pszFile, HTML_HELP_COMMAND uCommand, nuint dwData) 12where T : IHandle<HWND> 14HWND result = HtmlHelp(hwndCaller.Handle, pszFile, uCommand, dwData); 19/// <inheritdoc cref="HtmlHelp(HWND, string, HTML_HELP_COMMAND, nuint)" /> 20internal static unsafe HWND HtmlHelp<T>(T hwndCaller, string? pszFile, HTML_HELP_COMMAND uCommand, string? dwData) 21where T : IHandle<HWND> 25HWND result = HtmlHelp(hwndCaller.Handle, pszFile, uCommand, (nuint)d); 31/// <inheritdoc cref="HtmlHelp(HWND, string, HTML_HELP_COMMAND, nuint)" /> 32internal static unsafe HWND HtmlHelp<TCaller, TData>( 37where TCaller : IHandle<HWND> 42HWND result = HtmlHelp(hwndCaller.Handle, pszFile, uCommand, (nuint)v);
Windows\Win32\PInvoke.ImmGetContext.cs (2)
10/// <inheritdoc cref="ImmGetContext(HWND)"/> 11public static HIMC ImmGetContext<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.ImmReleaseContext.cs (2)
10/// <inheritdoc cref="ImmReleaseContext(HWND, HIMC)"/> 11public static BOOL ImmReleaseContext<T>(T hWnd, HIMC hIMC) where T : IHandle<HWND>
Windows\Win32\PInvoke.InvalidateRect.cs (2)
8/// <inheritdoc cref="InvalidateRect(HWND, RECT*, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.InvalidateRgn.cs (2)
8/// <inheritdoc cref="InvalidateRgn(HWND, HRGN, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.IsChild.cs (4)
8/// <inheritdoc cref="IsChild(HWND, HWND)"/> 10where TParent : IHandle<HWND> 11where TChild : IHandle<HWND>
Windows\Win32\PInvoke.IsWindow.cs (2)
8/// <inheritdoc cref="IsWindow(HWND)"/> 9public static BOOL IsWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.IsWindowEnabled.cs (2)
8/// <inheritdoc cref="IsWindowEnabled(HWND)"/> 9public static BOOL IsWindowEnabled<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.IsWindowVisible.cs (2)
8/// <inheritdoc cref="IsWindowVisible(HWND)"/> 9public static BOOL IsWindowVisible<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.KillTimer.cs (2)
8/// <inheritdoc cref="KillTimer(HWND, nuint)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.NotifyWinEvent.cs (2)
8/// <inheritdoc cref="NotifyWinEvent(uint, HWND, int, int)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.OpenThemeDataScope.cs (2)
26/// Opens the requested theme data using <see cref="OpenThemeData(HWND, string)"/>. 28public OpenThemeDataScope(HWND hwnd, string pszClassList)
Windows\Win32\PInvoke.RedrawWindow.cs (2)
8/// <inheritdoc cref="RedrawWindow(HWND, RECT*, HRGN, REDRAW_WINDOW_FLAGS)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.ScreenToClient.cs (2)
10/// <inheritdoc cref="ScreenToClient(HWND, ref Point)"/> 12where T : IHandle<HWND>
Windows\Win32\PInvoke.ScrollWindow.cs (2)
8/// <inheritdoc cref="ScrollWindow(HWND, int, int, RECT*, RECT*)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.ScrollWindowEx.cs (2)
8/// <inheritdoc cref="ScrollWindowEx(HWND, int, int, RECT*, RECT*, HRGN, RECT*, SCROLL_WINDOW_FLAGS)"/> 17SCROLL_WINDOW_FLAGS flags) where T : IHandle<HWND>
Windows\Win32\PInvoke.SendMessageCallback.cs (2)
17where T : IHandle<HWND> 26private static void NativeCallback(HWND hwnd, uint Msg, nuint dwData, LRESULT lResult)
Windows\Win32\PInvoke.SetActiveWindow.cs (4)
8/// <inheritdoc cref="SetActiveWindow(HWND)"/> 9public static HWND SetActiveWindow<T>(T hWnd) where T : IHandle<HWND> 11HWND result = SetActiveWindow(hWnd.Handle);
Windows\Win32\PInvoke.SetCapture.cs (2)
8/// <inheritdoc cref="SetCapture(HWND)"/> 9public static IntPtr SetCapture<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetFocus.cs (4)
8/// <inheritdoc cref="SetFocus(HWND)"/> 9public static HWND SetFocus<T>(T hWnd) where T : IHandle<HWND> 11HWND result = SetFocus(hWnd.Handle);
Windows\Win32\PInvoke.SetForegroundWindow.cs (2)
8/// <inheritdoc cref="SetForegroundWindow(HWND)"/> 9public static BOOL SetForegroundWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.SetLayeredWindowAttributes.cs (2)
8/// <inheritdoc cref="SetLayeredWindowAttributes(HWND, COLORREF, byte, LAYERED_WINDOW_ATTRIBUTES_FLAGS)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetMenu.cs (4)
8/// <inheritdoc cref="SetMenu(HWND, HMENU)"/> 10where T : IHandle<HWND> 17/// <inheritdoc cref="SetMenu(HWND, HMENU)"/> 19where T1 : IHandle<HWND>
Windows\Win32\PInvoke.SetParent.cs (6)
8/// <inheritdoc cref="SetParent(HWND, HWND)"/> 9public static HWND SetParent<TChild, TParent>(TChild hWndChild, TParent hWndNewParent) 10where TChild : IHandle<HWND> 11where TParent : IHandle<HWND> 13HWND result = SetParent(hWndChild.Handle, hWndNewParent.Handle);
Windows\Win32\PInvoke.SetScrollInfo.cs (2)
8/// <inheritdoc cref="SetScrollInfo(HWND, SCROLLBAR_CONSTANTS, in SCROLLINFO, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetScrollPos.cs (2)
8/// <inheritdoc cref="SetScrollPos(HWND, SCROLLBAR_CONSTANTS, int, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetTimer.cs (1)
9where T : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowPos.cs (4)
8/// <inheritdoc cref="SetWindowPos(HWND, HWND, int, int, int, int, SET_WINDOW_POS_FLAGS)"/> 10where T1 : IHandle<HWND> 11where T2 : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowRgn.cs (2)
8/// <inheritdoc cref="SetWindowRgn(HWND, HRGN, BOOL)"/> 10where T : IHandle<HWND>
Windows\Win32\PInvoke.SetWindowText.cs (2)
8/// <inheritdoc cref="SetWindowText(HWND, string)"/> 9public static BOOL SetWindowText<T>(T hWnd, string text) where T : IHandle<HWND>
Windows\Win32\PInvoke.SHAutoComplete.cs (2)
8/// <inheritdoc cref="SHAutoComplete(HWND, SHELL_AUTOCOMPLETE_FLAGS)"/> 9public static HRESULT SHAutoComplete<T>(T hwndEdit, SHELL_AUTOCOMPLETE_FLAGS flags) where T : IHandle<HWND>
Windows\Win32\PInvoke.ShowWindow.cs (2)
8/// <inheritdoc cref="ShowWindow(HWND, SHOW_WINDOW_CMD)"/> 9public static BOOL ShowWindow<T>(T hWnd, SHOW_WINDOW_CMD nCmdShow) where T : IHandle<HWND>
Windows\Win32\PInvoke.UiaHostProviderFromHwnd.cs (2)
10/// <inheritdoc cref="UiaHostProviderFromHwnd(HWND, IRawElementProviderSimple**)"/> 11public static unsafe HRESULT UiaHostProviderFromHwnd<T>(T hwnd, out IRawElementProviderSimple* ppProvider) where T : IHandle<HWND>
Windows\Win32\PInvoke.UiaReturnRawElementProvider.cs (2)
10/// <inheritdoc cref="UiaReturnRawElementProvider(HWND, WPARAM, LPARAM, IRawElementProviderSimple*)"/> 16where T : IHandle<HWND>
Windows\Win32\PInvoke.UpdateWindow.cs (2)
8/// <inheritdoc cref="UpdateWindow(HWND)"/> 9public static BOOL UpdateWindow<T>(T hWnd) where T : IHandle<HWND>
Windows\Win32\PInvoke.ValidateRect.cs (2)
8/// <inheritdoc cref="ValidateRect(HWND, RECT*)"/> 10where T : IHandle<HWND>
Windows\Win32\UI\Controls\Dialogs\CHOOSECOLORW.cs (3)
45public HWND hwndOwner; 61public HWND hInstance; 146public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnHook;
Windows\Win32\UI\Controls\Dialogs\CHOOSEFONTW.cs (2)
39public HWND hwndOwner; 142public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnHook;
Windows\Win32\UI\Controls\Dialogs\OPENFILENAME.cs (1)
10public HWND hwndOwner;
Windows\Win32\UI\Controls\Dialogs\PAGESETUPDLGW.cs (3)
52public HWND hwndOwner; 187public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnPageSetupHook; 203public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnPagePaintHook;
Windows\Win32\UI\Controls\Dialogs\PRINTDLGW_32.cs (3)
18public HWND hwndOwner; 42public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnPrintHook; 44public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnSetupHook;
Windows\Win32\UI\Controls\Dialogs\PRINTDLGW_64.cs (3)
47public HWND hwndOwner; 255public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnPrintHook; 270public unsafe delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint> lpfnSetupHook;
Windows\Win32\UI\Controls\ToolInfoWrapper.cs (2)
7where T : IHandle<HWND> 36public LRESULT SendMessage(IHandle<HWND> sender, MessageId message, bool state = false)
Windows\Win32\UI\Shell\FolderBrowserHelper.cs (2)
20HWND owner, 21delegate* unmanaged[Stdcall]<HWND, uint, LPARAM, LPARAM, int> callback,
System.Windows.Forms.Primitives.Tests (3)
Interop\User32\GetWindowTextTests.cs (3)
29HWND windowHandle = (HWND)windowClass.CreateWindow(shortText); 57protected override LRESULT WNDPROC(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam)
System.Windows.Forms.Primitives.TestUtilities (9)
Win32\Window.cs (2)
8internal class Window : IDisposable, IHandle<HWND> 12public HWND Handle { get; }
Win32\WindowClass.cs (7)
22public HWND MainWindow { get; private set; } 93lpfnWndProc = (delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)Marshal.GetFunctionPointerForDelegate(_windowProcedure), 131HWND parentWindow = default, 146public unsafe HWND CreateWindow( 152HWND parentWindow = default, 161HWND window; 217protected virtual LRESULT WNDPROC(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam)
System.Windows.Forms.Tests (36)
System\Windows\Forms\Application.ComponentManagerTests.cs (1)
380HWND IMsoComponent.Interface.HwndGetWindow(msocWindow uWhich, uint dwReserved)
System\Windows\Forms\CheckBoxRendererTests.cs (1)
141CheckBoxRenderer.DrawCheckBox(graphics, point, bounds, control.Text, SystemFonts.DefaultFont, TextFormatFlags.Default, focus, cBState, HWND.Null);
System\Windows\Forms\ClipboardTests.cs (2)
549private static extern bool OpenClipboard(HWND hWndNewOwner); 559OpenClipboard(HWND.Null).Should().BeTrue();
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;
System\Windows\Forms\ComboBoxTests.cs (1)
2797public AutomationEventCountingComboBoxChildEditUiaProvider(ComboBox owner, HWND childEditControlhandle) : base(owner, childEditControlhandle)
System\Windows\Forms\FileDialogTests.cs (2)
656Assert.Equal((HWND)(nint)1, o.hwndOwner); 752Assert.Equal((HWND)(nint)1, o.hwndOwner);
System\Windows\Forms\FormTests.cs (1)
2683var message = Message.Create(HWND.Null, PInvokeCore.WM_QUERYENDSESSION, wparam: default, lparam: default);
System\Windows\Forms\MdiControlStripTests.cs (1)
308IntPtr menuHandle = PInvoke.GetMenu((HWND)mdiParent.Handle);
System\Windows\Forms\RadioButtonRendererTests.cs (3)
136HWND.Null 311HWND hwnd = HWND.Null;
System\Windows\Forms\RichTextBoxTests.cs (1)
11017private static unsafe string GetClassName(HWND hWnd)
System\Windows\Forms\ScrollBarTests.cs (17)
617Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 747Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 762Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 797Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 812Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 883Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 905Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 946Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 969Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1069Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1091Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1132Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1154Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1614Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1636Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1678Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si)); 1700Assert.True(PInvoke.GetScrollInfo((HWND)control.Handle, SCROLLBAR_CONSTANTS.SB_CTL, ref si));
System\Windows\Forms\ToolStripItemTests.cs (1)
15618internal new void ReleaseUiaProvider(HWND handle)
System\Windows\Forms\ToolStripTests.cs (1)
492PInvokeCore.RevokeDragDrop((HWND)control.Handle);
System.Windows.Forms.TestUtilities (6)
DialogHostForm.cs (3)
23OnDialogIdle((HWND)m.LParamInternal); 29protected virtual void OnDialogIdle(HWND dialogHandle) 34protected static unsafe void Accept(HWND handle)
SystemEventsHelper.cs (3)
14private static HWND GetHWnd() 25HWND window = PInvoke.FindWindow(windowClassName, null); 31HWND window = GetHWnd();
System.Windows.Forms.UI.IntegrationTests (8)
DragDropTests.cs (2)
625(HWND)process.MainWindowHandle, 626HWND.HWND_TOP,
Infra\ControlTestBase.cs (1)
108Assert.Equal(HWND.Null, PInvoke.GetCapture());
Infra\SendInput.cs (2)
83PInvoke.SetWindowPos(window, HWND.HWND_TOPMOST, 0, 0, 0, 0, SET_WINDOW_POS_FLAGS.SWP_NOSIZE | SET_WINDOW_POS_FLAGS.SWP_NOMOVE); 103PInvoke.SetWindowPos(window, HWND.HWND_NOTOPMOST, 0, 0, 0, 0, SET_WINDOW_POS_FLAGS.SWP_NOSIZE | SET_WINDOW_POS_FLAGS.SWP_NOMOVE);
OpenFileDialogTests.cs (2)
69protected override void OnDialogIdle(HWND dialogHandle) 78protected override void OnDialogIdle(HWND dialogHandle)
PrintDialogTests.cs (1)
34protected override void OnDialogIdle(HWND dialogHandle)
WinFormsControlsTest (3)
ScalingBeforeChanges.cs (3)
31internal static void GetDevicePixels(HWND hwnd, out double x, out double y) 49GetDevicePixels((HWND)Handle, out _deviceDpiX, out _deviceDpiY); 88HWND.Null,