Python-UIAutomation-for-Windows icon indicating copy to clipboard operation
Python-UIAutomation-for-Windows copied to clipboard

"Parameter is incorrect" `COMError` with `ControlFromCursor` function

Open cmin764 opened this issue 2 years ago • 1 comments
trafficstars

This error happens when you retrieve elements with ControlFromPoint:

    control = auto.ControlFromCursor()
  File "Z:\Repos\rpaframework\packages\windows\.venv\lib\site-packages\uiautomation\uiautomation.py", line 8190, in ControlFromCursor
    return ControlFromPoint(x, y)
  File "Z:\Repos\rpaframework\packages\windows\.venv\lib\site-packages\uiautomation\uiautomation.py", line 8168, in ControlFromPoint
    element = _AutomationClient.instance().IUIAutomation.ElementFromPoint(ctypes.wintypes.POINT(x, y))
_ctypes.COMError: (-2147024809, 'The parameter is incorrect.', (None, None, None, 0, None))

in the following scenarios (where by point I mean retrieving the element at cursor's position):

  1. Point Calculator display, then its title bar.
  2. Point in Chrome and then its address bar or Desktop.
  3. Point inside the latest Notepad and then point to its title bar.
Screenshot_2023-03-01_at_17_14_30

OS: Windows 11 ARM (insider preview) on Mac M1 through Parallels.

Edition	Windows 11 Pro Insider Preview
Version	22H2
Installed on	‎23/‎02/‎2023
OS build	25300.1000
Experience	Windows Feature Experience Pack 1000.25300.1000.0

cmin764 avatar Mar 01 '23 09:03 cmin764

Sorry, I don't have an ARM Windows, I can't reproduce the issue.

yinkaisheng avatar Mar 18 '23 13:03 yinkaisheng