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