最近在做一个自动化的项目POC,其中某部分是用户鼠标移动点击获取控件信息,代码如下:
System.Windows.Point CurrentPt = new System.Windows.Point(mouse.x,mouse.y);
AutomationElement element=AutomationElement.FromPoint(CurrentPt);
对于我目前关心的控件,都能获取,但是vs的dockpane 标题都不能获取,如截图标识区域:
请问各位做过的前辈,我要随鼠标动态获取UI元素rectangle,应该怎样,为什么那块区域不能通过坐标获取,insepct也不能通过鼠标获取,但是在ui树上面又能显示