public static AutomationElement GetControlFromClientPos(AutomationElement window, int x, int y) { Point ptScr = UtilAutomation.Convert2Screen(window, new System.Windows.Point(x, y)); System.Windows.Point pp = new System.Windows.Point(); pp.X = ptScr.X; pp.Y = ptScr.Y; return(AutomationElement.FromPoint(pp)); }