Python-UIAutomation-for-Windows
Python-UIAutomation-for-Windows copied to clipboard
"Parameter is incorrect" `COMError` with `ControlFromCursor` function
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):
- Point Calculator display, then its title bar.
- Point in Chrome and then its address bar or Desktop.
- Point inside the latest Notepad and then point to its title bar.
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
Sorry, I don't have an ARM Windows, I can't reproduce the issue.