如何通过单独的 Java 进程访问 Windows GUI 文件菜单?
我目前有一个 Perl 进程,它使用 Win32 GuiTest 访问单独的 Windows GUI 进程的文件菜单。两个进程都在同一台 Windows (2K3x64) 服务器上运行。我想将其移植到 Java,并让 Java 进程操作 Windows GUI。
我研究过 Abbot、JaWin 和 JAB,但它们似乎都面向 Swing、AWT、Java 操作 Java Windows 等。
进程使用的 Win32 GuiTest 方法是:
FindWindowLike()
GetWindowText()
SetForeGroundWindow()
SendKeys()
GetFocus()
GetActiveWindow()
Perl 链接的示例将是理想的答案,任何与 MFC 相关的建议将不胜感激。谢谢!
I currently have a Perl process that uses Win32 GuiTest that accesses the file menu of a separate Windows GUI process. Both processes run on the same Windows (2K3x64) server. I would like to port it to Java, and have the Java process manipulate the Windows GUI.
I have looked into Abbot, JaWin, and JAB, but they all seem to be geared towards Swing, AWT, Java-manipulating-Java-Windows, etc.
The Win32 GuiTest methods that the Perl process uses are:
FindWindowLike()
GetWindowText()
SetForeGroundWindow()
SendKeys()
GetFocus()
GetActiveWindow()
While a Java code sample or linked example would be the ideal answer, any MFC-related suggestions would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IMO,你最好的选择是使用 JNI(Java 本机接口)。在此处查看一些与 Win32 UI 相关的示例。。以及此处的 Sun JNI TOC。
您列出的 GUI 测试方法听起来就像它们几乎一对一地映射到 Win32 API。 GetWindowText,用于例如,是 User32.dll 中定义的函数...
您还应该查看 JNA: https://github.com/twall/jna 或 J/Direct:http://www.codeguru.com/java/tij/tij0193.shtml
Your best bet, IMO, is to use JNI (Java Native Interface). Check out some Win32 UI-related samples here.. And Sun JNI TOC here.
The GUI test methods that you list sound like they map almost 1-to-1 to the Win32 API. GetWindowText, for example, is a function defined in the User32.dll...
You should also look into JNA: https://github.com/twall/jna or J/Direct: http://www.codeguru.com/java/tij/tij0193.shtml