/// <summary> /// 获取指定ID的子对象 /// 获取倒数第二级的子对象时会返回 (int32)1 ??? /// </summary> /// <param name="target"></param> /// <param name="ChildID">子对象的ID</param> /// <returns></returns> public static IAccessible GetChild(this IAccessible target, int ChildID) { Console.WriteLine($"获取对象 {target.GetHashCode().ToString("X")} 指定 ID= {ChildID} 的子对象..."); try { IAccessible[] Children = new IAccessible[target.accChildCount]; AccessibleChildren(target, ChildID, 1, Children, out int pcObtained); return(Children.FirstOrDefault()); } catch { return(null); } }