我正在尋找提高搜索文本集中性的方法AutomationElement(point)。 我已經有這樣的代碼。它使用UIAComWrapper並且非常慢。如何使用Microsoft UI Automation從Point獲取文本值?
public static string GetValueFromNativeElementFromPoint(Point p)
{
var element = UIAComWrapper::System.Windows.Automation.AutomationElement.FromPoint(p);
var pattern =
((UIAComWrapper::System.Windows.Automation.LegacyIAccessiblePattern)
element.GetCurrentPattern(UIAComWrapper::System.Windows.Automation.LegacyIAccessiblePattern.Pattern));
return pattern.Current.Value;
}