wpf icon indicating copy to clipboard operation
wpf copied to clipboard

UI Automation fails to correctly recognize ListView items on a DPI Unaware application

Open Kuldeep-MS opened this issue 1 year ago • 0 comments

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

  1. Develop a DPI-unaware application that contains a ListView with at least two items.

  2. 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.Name to a TextBox.

  3. In the Settings app, navigate to "System > Display" and set the scale to "150%".

  4. Launch the DPI-unaware application.

  5. Launch the WPF application.

  6. Position the mouse cursor just below the midpoint of the first item in the ListView within the DPI-unaware application.

  7. 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

Kuldeep-MS avatar Aug 12 '24 11:08 Kuldeep-MS