atfeel
2016-03-01 02:53Active Accessibility 接口技术 遍历元素,如何取得句柄
我现在已经能做到使用 Active Accessibility 接口技术 遍历元素出IE里面所有元素了,但是不知道如何取对应的句柄
这是我的部分代码
foreach (var childChild1 in clientChilren)
{
if (childChild1.GetType().ToString().IndexOf("Object") > -1)
{
IAccessible childChild = (IAccessible)childChild1;
accRole = (int)childChild.get_accRole(CHILDID_SELF);
accName = childChild.get_accName(CHILDID_SELF);
childChild.accLocation(out nLeft, out nTop, out nWidth, out nHeight, CHILDID_SELF);
//IntPtr handler = IntPtr.Zero;
此API不对,获取所有所有元素句柄都一样,而SPY里真正获取到的句柄是不一样的
//WindowFromAccessibleObject(childChild,ref handler);
Console.WriteLine("1--- "+ handler + " , " + accRole + " , " + accName + "," + nLeft + "," + nTop + "," + nWidth + "," + nHeight);
}
else
{
Console.WriteLine(clientChilren);
}
}
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- 迭代控制器和树枝中的对象
- json
- symfony
- php
- 2个回答
- too long
- json
- ajax
- arrays
- php
- 2个回答
- 在JSON解析时,Android应用程序停止工作
- json
- android
- php
- 1个回答
- AWS从PHP访问VPC中的RDS
- rds
- php
- 1个回答
- Google Material Icons as array - 任何想法?
- arrays
- php
- 2个回答
换一换