UI Automation fails to correctly recognize ListView items on a DPI Unaware application
Description
When you execute the AutomationElement.FromPoint method on a ListView that is placed in a DPI Unaware application window, it returns an item that is not under the specified point.
Reproduction Steps
-
Develop a DPI-unaware application that contains a
ListViewwith at least two items. -
Create a separate WPF application that retrieves the current mouse position and includes the following code:
POINT pt; GetCursorPos(out pt); Point pt2 = new Point(pt.X, pt.Y); AutomationElement ae = AutomationElement.FromPoint(pt2);Append
ae.Current.Nameto a TextBox. -
In the Settings app, navigate to "System > Display" and set the scale to "150%".
-
Launch the DPI-unaware application.
-
Launch the WPF application.
-
Position the mouse cursor just below the midpoint of the first item in the ListView within the DPI-unaware application.
-
After a short delay, review the results appended to the TextBox in the WPF application to verify detection accuracy.
Expected behavior
Finds item1
Actual behavior
Finds item2
Regression?
NO
Known Workarounds
No response
Impact
No response
Configuration
No response
Other information
No response