Exemplo n.º 1
0
        public int Find(String className, String name, int index)
        {
            AutomationElementCollection elements = Root.FindAll(TreeScope.Children, CustomConditions.ByName(name));

            if (elements.Count <= index)
            {
                return(0);
            }

            AutomationElement element = elements[index];

            return(element.Current.NativeWindowHandle);
        }
Exemplo n.º 2
0
        public int Find(int parent, String className, String name, int index)
        {
            AutomationElement baseElement = Find(parent);

            if (baseElement == null)
            {
                return(0);
            }

            AutomationElementCollection elements = baseElement.FindAll(TreeScope.Subtree, CustomConditions.ByName(name));

            if (elements.Count <= index)
            {
                return(0);
            }

            AutomationElement element = elements[index];

            return(element.Current.NativeWindowHandle);
        }