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

用SendKeys('{PageDown}')或DragDrop滚动页面后,下方的控件无法处理,报Can not move cursor. TextControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'XXX', ControlType: TextControl}错误

Open UshioYu opened this issue 2 years ago • 4 comments
trafficstars

pyWindow = auto.WindowControl(searchDepth=1, Name='aaa') pyWindow.SendKeys('{PageDown}') 或这段pyWindow.GroupControl().DragDrop(464, 500, 464, 680, moveSpeed=5, waitTime=1) pyWindow.TextControl(Name='bbb').Click()

执行后控制台报 -> Can not move cursor. TextControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'bbb', ControlType: TextControl} 有人遇到过类似的问题吗?

UshioYu avatar Feb 06 '23 01:02 UshioYu

有一些控件 Rectangle出来的坐标就是 (0,0,0,0),这个时候可以考虑直接用automation.DragDrop ,不通过识别不到的控件来获取,而是用其能够识别到的相对控件,然后计算radioX和radioY的偏移量来实现

zhouxihong1 avatar Feb 07 '23 04:02 zhouxihong1

有一些控件 Rectangle出来的坐标就是 (0,0,0,0),这个时候可以考虑直接用automation.DragDrop ,不通过识别不到的控件来获取,而是用其能够识别到的相对控件,然后计算radioX和radioY的偏移量来实现

我发现是我调用了滚动之后,下方的控件通过uiautomation抓取坐标是0,0,0,0,但是通过Inspect查看的BoundingRectangle是正常的。不行只能暂时通过做坐标去处理了

UshioYu avatar Feb 08 '23 07:02 UshioYu