diff --git a/src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.UiaReturnRawElementProvider.cs b/src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.UiaReturnRawElementProvider.cs index e3de52263f9..7ec2b63df80 100644 --- a/src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.UiaReturnRawElementProvider.cs +++ b/src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.UiaReturnRawElementProvider.cs @@ -9,7 +9,7 @@ internal partial class Interop internal static partial class UiaCore { [DllImport(Libraries.UiaCore, CharSet = CharSet.Unicode)] - public static extern nint UiaReturnRawElementProvider(IntPtr hwnd, nint wParam, nint lParam, IRawElementProviderSimple? el); + public static extern nint UiaReturnRawElementProvider(HWND hwnd, nint wParam, nint lParam, IRawElementProviderSimple? el); public static nint UiaReturnRawElementProvider(IHandle hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple? el) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.ComboBoxChildNativeWindow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.ComboBoxChildNativeWindow.cs index dcbb5a2f7e4..e73032cc211 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.ComboBoxChildNativeWindow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.ComboBoxChildNativeWindow.cs @@ -61,7 +61,7 @@ protected override void WndProc(ref Message m) { if (Handle != IntPtr.Zero) { - UiaCore.UiaReturnRawElementProvider(Handle, wParam: 0, lParam: 0, el: null); + UiaCore.UiaReturnRawElementProvider(HWND, wParam: 0, lParam: 0, el: null); } if (OsVersion.IsWindows8OrGreater()) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs index c8bede8ac02..ff0f853abc3 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs @@ -3228,7 +3228,7 @@ private void ReleaseChildWindow() } } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { if (!IsAccessibilityObjectCreated) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index 56a6131cb0b..2fea2e495be 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -2454,6 +2454,8 @@ public IntPtr Handle internal IntPtr HandleInternal => _window.Handle; + internal HWND HWNDInternal => _window.HWND; + /// /// True if this control has child controls in its collection. This /// is more efficient than checking for Controls.Count > 0, but has the @@ -9967,9 +9969,9 @@ public virtual void Refresh() /// Releases UI Automation provider for specified window. /// /// The window handle. - internal virtual void ReleaseUiaProvider(IntPtr handle) + internal virtual void ReleaseUiaProvider(HWND handle) { - if (handle != IntPtr.Zero) + if (!handle.IsNull) { // When a window that previously returned providers has been destroyed, // you should notify UI Automation by calling the UiaReturnRawElementProvider @@ -12114,7 +12116,7 @@ private void WmDestroy(ref Message m) if (SupportsUiaProviders) { - ReleaseUiaProvider(HandleInternal); + ReleaseUiaProvider(HWNDInternal); } OnHandleDestroyed(EventArgs.Empty); @@ -13640,7 +13642,6 @@ internal ToolStripControlHost? ToolStripControlHost HWND IHandle.Handle => HWND; internal HWND HWND => (HWND)Handle; - internal HWND HWNDInternal => (HWND)HandleInternal; internal virtual bool AllowsChildrenToShowToolTips() => true; } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.Methods.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.Methods.cs index b2279f6fc60..b3364d60fa5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.Methods.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridView.Methods.cs @@ -26104,7 +26104,7 @@ private void ReleaseMouse() Capture = false; } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { if (!IsAccessibilityObjectCreated) { @@ -26129,7 +26129,7 @@ internal override void ReleaseUiaProvider(IntPtr handle) column.HeaderCell.ReleaseUiaProvider(); } - _editingPanel?.ReleaseUiaProvider(IntPtr.Zero); + _editingPanel?.ReleaseUiaProvider(HWND.Null); _editingPanelAccessibleObject = null; _topLeftHeaderCell?.ReleaseUiaProvider(); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs index 2d60af10b07..46bbcd7a804 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxCell.cs @@ -2549,7 +2549,7 @@ public override object ParseFormattedValue( internal override void ReleaseUiaProvider() { - EditingComboBox?.ReleaseUiaProvider(IntPtr.Zero); + EditingComboBox?.ReleaseUiaProvider(HWND.Null); base.ReleaseUiaProvider(); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs index 58aa8c5d7ba..41f37c8770b 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewComboBoxEditingControl.cs @@ -169,7 +169,7 @@ protected override void OnHandleCreated(EventArgs e) } } - internal override void ReleaseUiaProvider(nint handle) + internal override void ReleaseUiaProvider(HWND handle) { if (TryGetAccessibilityObject(out AccessibleObject accessibleObject)) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs index 9294de5237f..bc41fe2b720 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/DataGridViewTextBoxEditingControl.cs @@ -285,7 +285,7 @@ protected override bool ProcessKeyEventArgs(ref Message m) return base.ProcessKeyEventArgs(ref m); } - internal override void ReleaseUiaProvider(nint handle) + internal override void ReleaseUiaProvider(HWND handle) { if (TryGetAccessibilityObject(out AccessibleObject? accessibleObject)) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs index f50908d0964..53cdd5ce89a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListBox.cs @@ -2083,7 +2083,7 @@ protected override void RefreshItem(int index) Items.SetItemInternal(index, Items[index]); } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { ClearListItemAccessibleObjects(); base.ReleaseUiaProvider(handle); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs index 4e99ae8aa10..453599e0883 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListView.cs @@ -5139,7 +5139,7 @@ public void RedrawItems(int startIndex, int endIndex, bool invalidateOnly) } } - internal override void ReleaseUiaProvider(nint handle) + internal override void ReleaseUiaProvider(HWND handle) { if (!OsVersion.IsWindows8OrGreater() || !IsAccessibilityObjectCreated) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ListViewLabelEditNativeWindow.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ListViewLabelEditNativeWindow.cs index 779aa24fce8..a2b04a6dce7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ListViewLabelEditNativeWindow.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ListViewLabelEditNativeWindow.cs @@ -79,7 +79,7 @@ public override void ReleaseHandle() // you should notify UI Automation by calling the UiaReturnRawElementProvider // as follows: UiaReturnRawElementProvider(hwnd, 0, 0, NULL). This call tells // UI Automation that it can safely remove all map entries that refer to the specified window. - UiaCore.UiaReturnRawElementProvider(Handle, wParam: 0, lParam: 0, el: null); + UiaCore.UiaReturnRawElementProvider(HWND, wParam: 0, lParam: 0, el: null); } if (OsVersion.IsWindows8OrGreater()) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs index b624f03b7ff..33e685bd475 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/MonthCalendar.cs @@ -1580,7 +1580,7 @@ protected virtual void OnRightToLeftLayoutChanged(EventArgs e) _onRightToLeftLayoutChanged?.Invoke(this, e); } - internal override void ReleaseUiaProvider(nint handle) + internal override void ReleaseUiaProvider(HWND handle) { if (OsVersion.IsWindows8OrGreater() && IsAccessibilityObjectCreated) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.TabPageCollection.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.TabPageCollection.cs index bd9fa30e133..31b6a2a3aab 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.TabPageCollection.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/TabControl.TabPageCollection.cs @@ -342,7 +342,7 @@ public void Remove(TabPage value) _owner.Controls.Remove(value); if (value.IsHandleCreated) { - value.ReleaseUiaProvider(value.HandleInternal); + value.ReleaseUiaProvider(value.HWNDInternal); } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs index a2a54ac9f2a..587acd77d55 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/TabPage.cs @@ -620,7 +620,7 @@ protected override void OnPaintBackground(PaintEventArgs e) } } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { if (OsVersion.IsWindows8OrGreater()) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs index caaedd4dd20..783ba9a4541 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStrip.cs @@ -4166,7 +4166,7 @@ public ToolStripItem GetItemAt(Point point) return null; } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { if (!IsAccessibilityObjectCreated) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.cs index 1d2cc1262e3..e72c654035a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripControlHost.cs @@ -872,7 +872,7 @@ protected override void SetVisibleCore(bool visible) internal override void ReleaseUiaProvider() { - _control?.ReleaseUiaProvider(IntPtr.Zero); + _control?.ReleaseUiaProvider(HWND.Null); base.ReleaseUiaProvider(); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs index 6c4012597da..ac4ad79adce 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ToolStripDropDownItem.cs @@ -617,7 +617,7 @@ protected internal override bool ProcessDialogKey(Keys keyData) internal override void ReleaseUiaProvider() { - _dropDown?.ReleaseUiaProvider(IntPtr.Zero); + _dropDown?.ReleaseUiaProvider(HWND.Null); base.ReleaseUiaProvider(); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs b/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs index 88ce079ef16..d2a40466af7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/TreeView.cs @@ -177,7 +177,7 @@ public TreeView() SetStyle(ControlStyles.UseTextForAccessibility, false); } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { foreach (TreeNode rootNode in Nodes) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.UpDownButtons.cs b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.UpDownButtons.cs index 5cce20932dc..f7ed72c0049 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.UpDownButtons.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.UpDownButtons.cs @@ -337,7 +337,7 @@ protected override void OnPaint(PaintEventArgs e) protected virtual void OnUpDown(UpDownEventArgs upevent) => _upDownEventHandler?.Invoke(this, upevent); - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { if (IsAccessibilityObjectCreated && OsVersion.IsWindows8OrGreater() diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs index 0b96763f875..85a5824b179 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/UpDownBase.cs @@ -457,14 +457,14 @@ internal override Rectangle ApplyBoundsConstraints(int suggestedX, int suggested return base.ApplyBoundsConstraints(suggestedX, suggestedY, proposedWidth, PreferredHeight); } - internal override void ReleaseUiaProvider(IntPtr handle) + internal override void ReleaseUiaProvider(HWND handle) { // UpDownEdit as TextBox is a control, that should disconnect its accessible object itself, // but if it supports Uia providers. If no, force disconnecting for UpDownEdit accessible object // as a part of UIA tree of Domain/NumericUpDown controls. if (!_upDownEdit.SupportsUiaProviders) { - _upDownEdit.ReleaseUiaProvider(_upDownEdit.HandleInternal); + _upDownEdit.ReleaseUiaProvider(_upDownEdit.HWNDInternal); } base.ReleaseUiaProvider(handle); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs index 84b0c9f67df..152aaf42319 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs @@ -48,7 +48,7 @@ public void ListViewColumnHeaderAccessibleObject_IsDisconnected_WhenListViewRele EnforceAccessibleObjectCreation(columnHeader); _ = listView.AccessibilityObject; - listView.ReleaseUiaProvider(listView.Handle); + listView.ReleaseUiaProvider(listView.HWND); Assert.Null(columnHeader.TestAccessor().Dynamic._accessibilityObject); Assert.True(listView.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBox.ComboBoxAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBox.ComboBoxAccessibleObjectTests.cs index 30f46d7cdd4..4740134a488 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBox.ComboBoxAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComboBox.ComboBoxAccessibleObjectTests.cs @@ -418,7 +418,7 @@ public void ComboBox_ReleaseUiaProvider_ClearsItemsAccessibleObjects() Assert.Equal(comboBox.Items.Count, accessibleObject.ItemAccessibleObjects.Count); - comboBox.ReleaseUiaProvider(comboBox.Handle); + comboBox.ReleaseUiaProvider(comboBox.HWND); Assert.Equal(0, accessibleObject.ItemAccessibleObjects.Count); Assert.True(comboBox.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListBoxAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListBoxAccessibleObjectTests.cs index d60d1a0f055..537c6cb23e5 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListBoxAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListBoxAccessibleObjectTests.cs @@ -100,7 +100,7 @@ public void ListBox_ReleaseUiaProvider_ClearsItemsAccessibleObjects() using ListBox listBox = CreateListBoxWithItems(); ListBoxAccessibleObject accessibleObject = InitListBoxItemsAccessibleObjects(listBox); - listBox.ReleaseUiaProvider(listBox.Handle); + listBox.ReleaseUiaProvider(listBox.HWND); Assert.Equal(0, accessibleObject.TestAccessor().Dynamic._itemAccessibleObjects.Count); } diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewGroup.ListViewGroupAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewGroup.ListViewGroupAccessibleObjectTests.cs index 2efc420ce49..dc9f40d31f5 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewGroup.ListViewGroupAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewGroup.ListViewGroupAccessibleObjectTests.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -1353,7 +1353,7 @@ public void ListViewGroupAccessibleObject_IsDisconnected_WhenListViewReleasesUia EnforceAccessibleObjectCreation(group); EnforceAccessibleObjectCreation(listView.DefaultGroup); - listView.ReleaseUiaProvider(listView.Handle); + listView.ReleaseUiaProvider(listView.HWND); Assert.Null(group.TestAccessor().Dynamic._accessibilityObject); Assert.Null(listView.DefaultGroup.TestAccessor().Dynamic._accessibilityObject); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewItemAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewItemAccessibleObjectTests.cs index d2ad668a21a..1d29d28108a 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewItemAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewItemAccessibleObjectTests.cs @@ -1846,7 +1846,7 @@ public void ListViewItemAccessibleObject_IsDisconnected_WhenListViewReleasesUiaP listView.Items.Add(item); EnforceAccessibleObjectCreation(item); - listView.ReleaseUiaProvider(listView.Handle); + listView.ReleaseUiaProvider(listView.HWND); Assert.Null(item.TestAccessor().Dynamic._accessibilityObject); Assert.True(listView.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs index b0d073fac53..da5ed429c59 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs @@ -1061,7 +1061,7 @@ public void ListViewSubItemAccessibleObject_IsDisconnected_WhenListViewReleasesU listView.Items.Add(listViewItem); EnforceAccessibleObjectCreation(listViewItem); - listView.ReleaseUiaProvider(listView.Handle); + listView.ReleaseUiaProvider(listView.HWND); Assert.Null(listViewSubItem.TestAccessor().Dynamic._accessibilityObject); Assert.True(listView.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs index f47275f2775..276f0e05105 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListViewTests.cs @@ -5745,7 +5745,7 @@ public void ListView_ReleaseUiaProvider_DoesNotForceDefaultGroupCreation() using ListView listView = new(); _ = listView.AccessibilityObject; - listView.ReleaseUiaProvider(listView.Handle); + listView.ReleaseUiaProvider(listView.HWND); Assert.Null(listView.TestAccessor().Dynamic._defaultGroup); Assert.True(listView.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TabPage.TabAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TabPage.TabAccessibleObjectTests.cs index 28b2b6fc670..cbe861fa2da 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TabPage.TabAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TabPage.TabAccessibleObjectTests.cs @@ -39,7 +39,7 @@ public void TabAccessibilityObject_IsDisconnected_WhenTabPageReleasesUiaProvider using TabPage tabPage = new(); EnforceTabAccessibilityObjectCreation(tabPage); - tabPage.ReleaseUiaProvider(tabPage.Handle); + tabPage.ReleaseUiaProvider(tabPage.HWND); Assert.Null(tabPage.TestAccessor().Dynamic._tabAccessibilityObject); Assert.True(tabPage.IsHandleCreated); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs index 72214c8abcd..f85872b5a72 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ToolStripItemTests.cs @@ -7076,7 +7076,7 @@ public void ToolStripItem_Releases_UiaProvider() _ = toolStrip.AccessibilityObject; Assert.True(toolStrip.IsAccessibilityObjectCreated); - toolStrip.ReleaseUiaProvider(toolStrip.Handle); + toolStrip.ReleaseUiaProvider(toolStrip.HWND); Assert.Equal(1, toolStrip.Disconnects); Assert.True(toolStripDropDownItem1.IsAccessibleObjectCleared()); @@ -15574,7 +15574,7 @@ public ToolStripWithDisconnectCount() : base() { } public int Disconnects { get; private set; } - internal new void ReleaseUiaProvider(IntPtr handle) + internal new void ReleaseUiaProvider(HWND handle) { base.ReleaseUiaProvider(handle); diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.TreeNodeAccessibleObjectTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.TreeNodeAccessibleObjectTests.cs index 9de096b7426..c5f6c95c2b5 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.TreeNodeAccessibleObjectTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/TreeNode.TreeNodeAccessibleObjectTests.cs @@ -501,7 +501,7 @@ public void TreeNodeAccessibleObject_IsDisconnected_WhenTreeViewIsReleased() secondLevelNode.Nodes.Add(thirdLevelNode); control.CreateControl(); - control.ReleaseUiaProvider(control.Handle); + control.ReleaseUiaProvider(control.HWND); Assert.True(firstLevelNode.IsAccessibilityObjectDisconnected); Assert.True(secondLevelNode.IsAccessibilityObjectDisconnected);