111,102
社区成员




AutomationElement aeTop = AutomationElement.RootElement; //找到桌面根元素
AutomationElement aeForm = aeTop.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "XXXX交流群")); //找到XXXX交流群的聊天窗口
AutomationElement aeMessage= aeForm .FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.NameProperty, "消息")); //找不到消息区,aeMessage值为空
AutomationElement focusedElement = AutomationElement.FocusedElement; //获取当前焦点AutomationElement元素
AutomationElement pointElement= AutomationElement.FromPoint(new System.Windows.Point(868, 346)); //获取指定点处AutomationElement元素