我的目标是控制应用程序VB.NET http://en.wikipedia.org/wiki/Visual_Basic_.NET。没有API,我也没有源码,只有编译好的EXE文件。有没有办法找到打开的应用程序,在应用程序中找到一个按钮,单击一个按钮并知道它被单击了?有没有办法读取应用程序中文本框的内容?
是的,使用 Windows Vista(或 Windows 7,或Windows Server 2003 http://en.wikipedia.org/wiki/Windows_Server_2003以及稍后)有“用户界面自动化 http://msdn.microsoft.com/en-us/library/ms747327.aspx" APIs.
有托管选项;系统.Windows.自动化 http://www.bing.com/search?q=System.windows.automation是其中之一,随 .NET 3.0 一起提供,作为WPF http://en.wikipedia.org/wiki/Windows_Presentation_Foundation... 尽管System.Windows.Automation
作为 WPF 的一部分提供,它不要求目标应用程序使用 WPF。
您可以阅读更多内容:
- the UI 自动化博客 http://blogs.msdn.com/winuiautomation/.
-
MSDN 杂志文章 http://msdn.microsoft.com/en-us/magazine/cc163301.aspx- 谈论使用电源外壳 http://en.wikipedia.org/wiki/Windows_PowerShell with
System.Management.Automation.dll
(替代System.Windows.Automation
).
-
塞缪尔·杰克的博客文章 http://blog.functionalfun.net/2009/06/introduction-to-ui-automation-with.html- 描述使用
System.Windows.Automation
自动化画图网 http://en.wikipedia.org/wiki/Paint.NET程序(C#)。
-
代码项目文章 #1 http://www.codeproject.com/KB/WPF/automator.aspx显示使用 UI Automation 来测试安装程序
-
代码项目文章 #2 http://www.codeproject.com/KB/WPF/WPF_UI_Automation.aspx提供了使用的基本介绍
System.Windows.Automation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)