126 references to HWND
System.Windows.Forms (102)
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)
1149
get => IsHandleCreated && PInvoke.GetCapture() ==
HWND
;
1590
if ((r.left <= p.X && p.X < r.right && r.top <= p.Y && p.Y < r.bottom) || PInvoke.GetCapture() ==
HWND
)
1592
PInvokeCore.SendMessage(this, PInvokeCore.WM_SETCURSOR, (WPARAM)
HWND
, (LPARAM)(int)PInvoke.HTCLIENT);
2341
HWND start = parent is not null ? parent.
HWND
:
HWND
;
2840
using RegionScope regionHandle = (regionCopy ?? region).GetRegionScope(
HWND
);
4684
control.SetParentHandle(
HWND
);
5845
hwndTrack =
HWND
,
7189
Message m = Message.Create(
HWND
, PInvokeCore.WM_PRINTCLIENT, (WPARAM)hdc, (LPARAM)flags);
7411
hwnd:
HWND
,
9374
hwnd:
HWND
,
10433
PrepareDarkMode(
HWND
, Application.IsDarkModeEnabled);
10436
PInvoke.ShowWindow(
HWND
, value ? ShowParams : SHOW_WINDOW_CMD.SW_HIDE);
11035
previous = child.
HWND
;
11142
HWND parentHandle =
HWND
;
11681
PInvokeCore.SendMessage(this, PInvokeCore.WM_CONTEXTMENU, (WPARAM)
HWND
, (LPARAM)screenLocation);
11688
&& PInvoke.WindowFromPoint(screenLocation) ==
HWND
;
11842
using var paintScope = usingBeginPaint ? new BeginPaintScope(
HWND
) : default;
11963
using GetDcScope dc = new(
HWND
);
12951
HWND IHandle<HWND>.Handle =>
HWND
;
System\Windows\Forms\Controls\Buttons\Button.cs (1)
268
if (PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) ==
HWND
&& !ValidationCancelled)
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
509
&& PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) ==
HWND
)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
487
&& PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) ==
HWND
)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (4)
2351
PInvoke.SetWindowTheme(
HWND
, $"{DarkModeIdentifier}_{ComboBoxButtonThemeIdentifier}", null);
2356
_ = PInvoke.GetComboBoxInfo(
HWND
, ref cInfo);
3779
bool getRegionSucceeded = PInvoke.GetUpdateRgn(
HWND
, windowRegion, bErase: true) != GDI_REGION_TYPE.RGN_ERROR;
3787
using var paintScope = useBeginPaint ? new BeginPaintScope(
HWND
) : default;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
5703
using GetDcScope dc = new(
HWND
, HRGN.Null, GET_DCX_FLAGS.DCX_CACHE | GET_DCX_FLAGS.DCX_LOCKWINDOWUPDATE);
5722
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)
2420
if (captured && PInvoke.WindowFromPoint(PointToScreen(point)) ==
HWND
)
2460
if (Capture && PInvoke.WindowFromPoint(PointToScreen((Point)m.LParamInternal)) ==
HWND
)
System\Windows\Forms\Controls\ListView\ListView.cs (1)
4690
HWND
,
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1821
PInvokeCore.SendMessage(
HWND
, PInvoke.MCM_SETDAYSTATE, (WPARAM)monthsCount, (LPARAM)arr);
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
85
PInvoke.SetWindowTheme(
HWND
, " ", " ");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
2393
using GetDcScope hdc = new(
HWND
);
3726
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)
697
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)
1304
PInvoke.SetWindowTheme(
HWND
, null, $"{DarkModeIdentifier}::{BannerContainerThemeIdentifier}");
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
952
using BeginPaintScope paintScope = new(
HWND
);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
1483
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)
3051
PInvokeCore.SendMessage(this, PInvokeCore.WM_CONTEXTMENU, (WPARAM)
HWND
, (LPARAM)PInvoke.GetMessagePos());
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
694
if (PInvoke.WindowFromPoint(PointToScreen(mevent.Location)) ==
HWND
&& !ValidationCancelled)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (1)
234
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 (18)
1790
PInvoke.SetWindowDisplayAffinity(
HWND
, WINDOW_DISPLAY_AFFINITY.WDA_NONE);
1800
PInvoke.SetWindowDisplayAffinity(
HWND
, affinity);
2320
HWND
,
2513
HWND
,
2526
HWND
,
2828
PInvokeCore.SendMessage(MdiParentInternal.MdiClient, PInvokeCore.WM_MDIACTIVATE, (WPARAM)
HWND
);
3491
_ctlClient.
HWND
,
4713
PInvoke.TranslateMDISysAccel(_ctlClient.
HWND
, win32Message))
4906
bool result = PInvoke.GetWindowPlacement(
HWND
, &wp);
4923
callback = new EnumThreadWindowsCallback(
HWND
);
4950
bool result = PInvoke.SetWindowPlacement(
HWND
, &wp);
5134
PInvokeCore.SendMessage(MdiParentInternal.MdiClient, PInvokeCore.WM_MDIACTIVATE, (WPARAM)
HWND
);
5486
if (!ownerHwnd.IsNull && ownerHwnd.Handle !=
HWND
)
5489
if (PInvokeCore.GetWindowLong(ownerHwnd, WINDOW_LONG_PTR_INDEX.GWL_HWNDPARENT) ==
HWND
)
5740
if (!ownerHwnd.IsNull && ownerHwnd.Handle !=
HWND
)
6514
PInvoke.GetWindowPlacement(
HWND
, &wp);
6947
if (
HWND
== (HWND)m.WParamInternal)
6951
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)
250
bool result = PInvoke.GetWindowPlacement(child.
HWND
, &wp);
266
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)
732
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
);