Windows UI 自动化 API
我已经尝试解决这个问题有一段时间了,所以任何帮助将不胜感激。我在客户端中使用 UI 自动化来监视和报告另一个应用程序中的用户选择。我的代码在 Server 2003 上完美运行。然而,在 Server 2008 上,我正在监视的控件被报告为数据网格或列表中的项目。这是非常随机的,我注意到如果我继续选择控件中的行,最终控件将被报告为数据网格。在服务器 2003 上,它始终被报告为数据网格,因此我的代码运行良好。
我正在 Visual Studio 2010 C# 中进行开发。
更新:
我想提一下,我使用 UI Spy 工具得到了相同的结果,因此源代码在这种特定情况下不相关。
I have been trying to figure this out for a while so any help would be greatly appreciated. I am using UI Automation in my client to monitor and report on user selection within another application. I got the code working perfectly on Server 2003. On Server 2008 however, the control which I am monitoring is being reported as either an item within a data grid or a list. It's very random and I noticed that if I keep on selecting rows within the control, eventually the control will be reported as a data grid. On server 2003, it was always reported as a data grid and so my code works perfectly.
I am developing in Visual Studio 2010 C#.
Update:
I wanted to mention that I got the same results using the UI Spy tool so the source-code is not relevant in this specific case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据几个方面,UltraGrid 重新创建其句柄(有时甚至相当频繁)...这可能会扰乱 UI 自动化对其的感知方式...我认为您无法从目标外部对其执行任何操作应用程序...
附加信息:
根据 这个。
目前唯一支持的自动化解决方案是来自同一供应商的 TestAdvantage 产品。
尽管他们似乎正在努力在接下来的几个月内添加对 Windows UI 自动化的支持......
Depending on several aspects the UltraGrid recreates its handle (sometimes even rather often)... this could mess with how it is perceived by UI automation... I don't think that there is anything you can do about it from outside the target application...
Additional information:
The control in question (Infragistics UltraGrid) does NOT have any support for the Windows/MS UI Automation according to this.
Currently the only automation solution supported is the TestAdvantage product from the same vendor.
Although they seem to be working on adding support for Windows UI automation within the next months...