125 references to HWND
System.Windows.Forms (101)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (2)
207/// Second item can be anything unique, Win32 uses <see cref="HWND"/>, we copied that. 243_handle = Owner?.HWND ?? default;
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (1)
615*phwnd = _parent.HWND;
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (1)
263public HWND Hwnd => GetControl()?.HWND ?? HWND.Null;
System\Windows\Forms\ActiveX\AxHost.cs (5)
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;
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (2)
345*phwnd = _host.ParentInternal?.HWND ?? HWND.Null; 402lpFrameInfo->hwndFrame = _host.ParentInternal?.HWND ?? HWND.Null;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
357if (hwnd != _control.HWND && lpmsg->IsMouseMessage())
System\Windows\Forms\Application.ParkingWindow.cs (1)
128PInvoke.GetParent(handle) != HWND,
System\Windows\Forms\Application.ThreadWindows.cs (1)
63_focusedHwnd = activatingControl is not null ? activatingControl.HWND : PInvoke.GetFocus();
System\Windows\Forms\Control.cs (20)
1123get => IsHandleCreated && PInvoke.GetCapture() == HWND; 1564if ((r.left <= p.X && p.X < r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND) 1566PInvokeCore.SendMessage(this, PInvokeCore.WM_SETCURSOR, (WPARAM)HWND, (LPARAM)(int)PInvoke.HTCLIENT); 2315HWND start = parent is not null ? parent.HWND : HWND; 2814using RegionScope regionHandle = (regionCopy ?? region).GetRegionScope(HWND); 4658control.SetParentHandle(HWND); 5819hwndTrack = HWND, 7163Message m = Message.Create(HWND, PInvokeCore.WM_PRINTCLIENT, (WPARAM)hdc, (LPARAM)flags); 7386hwnd: HWND, 9350hwnd: HWND, 10396PrepareDarkMode(HWND, Application.IsDarkModeEnabled); 10399PInvoke.ShowWindow(HWND, value ? ShowParams : SHOW_WINDOW_CMD.SW_HIDE); 10998previous = child.HWND; 11105HWND parentHandle = HWND; 11644PInvokeCore.SendMessage(this, PInvokeCore.WM_CONTEXTMENU, (WPARAM)HWND, (LPARAM)screenLocation); 11651&& PInvoke.WindowFromPoint(screenLocation) == HWND; 11805using var paintScope = usingBeginPaint ? new BeginPaintScope(HWND) : default; 11926using GetDcScope dc = new(HWND); 12914HWND IHandle<HWND>.Handle => HWND;
System\Windows\Forms\Controls\Buttons\Button.cs (1)
269if (PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) == HWND && !ValidationCancelled)
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
513&& PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) == HWND)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
489&& PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) == HWND)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (4)
2341PInvoke.SetWindowTheme(HWND, $"{DarkModeIdentifier}_{ComboBoxButtonThemeIdentifier}", null); 2346_ = PInvoke.GetComboBoxInfo(HWND, ref cInfo); 3740bool getRegionSucceeded = PInvoke.GetUpdateRgn(HWND, windowRegion, bErase: true) != GDI_REGION_TYPE.RGN_ERROR; 3748using var paintScope = useBeginPaint ? new BeginPaintScope(HWND) : default;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
5706using GetDcScope dc = new(HWND, HRGN.Null, GET_DCX_FLAGS.DCX_CACHE | GET_DCX_FLAGS.DCX_LOCKWINDOWUPDATE); 5725using GetDcScope dc = new(HWND, HRGN.Null, GET_DCX_FLAGS.DCX_CACHE | GET_DCX_FLAGS.DCX_LOCKWINDOWUPDATE);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
302if ((r.left <= p.X && p.X < r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND) 304PInvokeCore.SendMessage(this, PInvokeCore.WM_SETCURSOR, (WPARAM)HWND, (LPARAM)(int)PInvoke.HTCLIENT);
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
2422if (captured && PInvoke.WindowFromPoint(PointToScreen(point)) == HWND) 2462if (Capture && PInvoke.WindowFromPoint(PointToScreen((Point)m.LParamInternal)) == HWND)
System\Windows\Forms\Controls\ListView\ListView.cs (1)
4696HWND,
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1827PInvokeCore.SendMessage(HWND, PInvoke.MCM_SETDAYSTATE, (WPARAM)monthsCount, (LPARAM)arr);
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
87PInvoke.SetWindowTheme(HWND, " ", " ");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
2370using GetDcScope hdc = new(HWND); 3703using GetDcScope hdc = new(DropDownListBox.HWND);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
274if (hWnd == HWND)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (1)
165DragDropHelper.DragEnter(_owner.HWND, e);
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
699using GetDcScope dc = new(ParentInternal.HWND, HRGN.Null, GET_DCX_FLAGS.DCX_CACHE | GET_DCX_FLAGS.DCX_LOCKWINDOWUPDATE);
System\Windows\Forms\Controls\TabControl\TabControl.cs (1)
1307PInvoke.SetWindowTheme(HWND, null, $"{DarkModeIdentifier}::{BannerContainerThemeIdentifier}");
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
958using BeginPaintScope paintScope = new(HWND);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
1489if (!ValidationCancelled && PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) == HWND)
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
457using GetDcScope hdc = new(Owner.HWND);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
4605if (hwndClicked == HWND)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
227DragDropHelper.DragEnter(toolStrip.HWND, dragEnterArgs);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
337&& activeToolStripDropDown.OwnerToolStrip.HWND == hwndMouseMessageIsFrom
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
3064PInvokeCore.SendMessage(this, PInvokeCore.WM_CONTEXTMENU, (WPARAM)HWND, (LPARAM)PInvoke.GetMessagePos());
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
692if (PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) == HWND && !ValidationCancelled)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (1)
222if (!_parent.ValidationCancelled && PInvoke.WindowFromPoint(PointToScreen(e.Location)) == HWND)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownEdit.cs (1)
66if (!_parent.ValidationCancelled && PInvoke.WindowFromPoint(PointToScreen(e.Location)) == HWND)
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
673HRESULT hr = _axOleObject!.DoVerb((int)verb, null, clientSite, 0, HWND, &posRect);
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (1)
76*phwnd = _parent.HWND;
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
271lpFrameInfo->hwndFrame = Host.ParentInternal is { } parent ? parent.HWND : HWND.Null;
System\Windows\Forms\Form.cs (17)
1801PInvoke.SetWindowDisplayAffinity(HWND, affinity); 2325HWND, 2524HWND, 2537HWND, 2843PInvokeCore.SendMessage(MdiParentInternal.MdiClient, PInvokeCore.WM_MDIACTIVATE, (WPARAM)HWND); 3506_ctlClient.HWND, 4731PInvoke.TranslateMDISysAccel(_ctlClient.HWND, win32Message)) 4924bool result = PInvoke.GetWindowPlacement(HWND, &wp); 4941callback = new EnumThreadWindowsCallback(HWND); 4968bool result = PInvoke.SetWindowPlacement(HWND, &wp); 5154PInvokeCore.SendMessage(MdiParentInternal.MdiClient, PInvokeCore.WM_MDIACTIVATE, (WPARAM)HWND); 5506if (!ownerHwnd.IsNull && ownerHwnd.Handle != HWND) 5509if (PInvokeCore.GetWindowLong(ownerHwnd, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT) == HWND) 5733if (!ownerHwnd.IsNull && ownerHwnd.Handle != HWND) 6498PInvoke.GetWindowPlacement(HWND, &wp); 6931if (HWND == (HWND)m.WParamInternal) 6935else if (HWND == m.LParamInternal)
System\Windows\Forms\Layout\Containers\SplitContainer.cs (3)
453if ((r.left <= p.X && p.X < r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() == HWND) 455PInvokeCore.SendMessage(this, PInvokeCore.WM_SETCURSOR, (WPARAM)HWND, (LPARAM)(int)PInvoke.HTCLIENT); 1474using GetDcScope dc = new(HWND, HRGN.Null, GET_DCX_FLAGS.DCX_CACHE | GET_DCX_FLAGS.DCX_LOCKWINDOWUPDATE);
System\Windows\Forms\MDI\MDIClient.cs (2)
252bool result = PInvoke.GetWindowPlacement(child.HWND, &wp); 268PInvoke.SetWindowPlacement(child.HWND, &wp);
System\Windows\Forms\OLE\DropTarget.cs (2)
27_hwndTarget = control.HWND; 33_hwndTarget = toolStrip.HWND;
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
476using GetDcScope hdc = new(HWND);
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
734if (PInvoke.GetFocus() == HWND)
System\Windows\Forms\ToolTip\ToolTip.cs (4)
1050HWND baseHwnd = current?.HWND ?? HWND.Null; 1079hwnd = current.HWND; 1086baseHwnd = current.HWND; 1845_owners[windowAsControl.HWND] = windowAsControl;
System\Windows\Forms\UserControl.cs (1)
254return HWND == hwndFocus || PInvoke.IsChild(this, hwndFocus);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
348_lastHResult = PInvoke.DrawThemeParentBackground(childControl.HWND, hdc, bounds);
System.Windows.Forms.Tests (24)
System\Windows\Forms\AccessibleObjects\ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs (1)
52listView.ReleaseUiaProvider(listView.HWND);
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxAccessibleObjectTests.cs (1)
423comboBox.ReleaseUiaProvider(comboBox.HWND);
System\Windows\Forms\AccessibleObjects\LinkLabel.LinkLabelAccessibleObjectTests.cs (1)
186linkLabel.ReleaseUiaProvider(linkLabel.HWND);
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (1)
103listBox.ReleaseUiaProvider(listBox.HWND);
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (1)
1357listView.ReleaseUiaProvider(listView.HWND);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (1)
1852listView.ReleaseUiaProvider(listView.HWND);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
1070listView.ReleaseUiaProvider(listView.HWND);
System\Windows\Forms\AccessibleObjects\TabPage.TabAccessibleObjectTests.cs (1)
41tabPage.ReleaseUiaProvider(tabPage.HWND);
System\Windows\Forms\AccessibleObjects\TreeNode.TreeNodeAccessibleObjectTests.cs (1)
529control.ReleaseUiaProvider(control.HWND);
System\Windows\Forms\Application.ParkingWindowTests.cs (6)
83DPI_AWARENESS_CONTEXT dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND); 118DPI_AWARENESS_CONTEXT dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND); 152DPI_AWARENESS_CONTEXT dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND); 184DPI_AWARENESS_CONTEXT dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND); 195dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND); 202dpiContext = PInvoke.GetWindowDpiAwarenessContext(parkingWindow.HWND);
System\Windows\Forms\ComponentModel\Com2Interop\ComNativeDescriptorTests.cs (1)
164control.HWND,
System\Windows\Forms\ListViewTests.cs (1)
5864listView.ReleaseUiaProvider(listView.HWND);
System\Windows\Forms\MixedDpiHostingTests.cs (2)
38DPI_AWARENESS_CONTEXT controlDpiContext = PInvoke.GetWindowDpiAwarenessContext(control.HWND); 39DPI_AWARENESS_CONTEXT formDpiContext = PInvoke.GetWindowDpiAwarenessContext(form.HWND);
System\Windows\Forms\RichTextBoxTests.cs (3)
10559Assert.Contains("RICHEDIT50W", GetClassName(control.HWND), StringComparison.Ordinal); 10568Assert.Contains(".RichEdit.", GetClassName(riched32.HWND), StringComparison.Ordinal); 10573Assert.Contains(".RichEdit20W.", GetClassName(riched20.HWND), StringComparison.Ordinal);
System\Windows\Forms\ScrollBarTests.cs (1)
440Assert.True(PInvoke.GetScrollInfo(control.HWND, SCROLLBAR_CONSTANTS.SB_CTL, ref si));
System\Windows\Forms\ToolStripItemTests.cs (1)
7088toolStrip.ReleaseUiaProvider(toolStrip.HWND);