如何使用Java控制WindowXP的Windows
我需要使用Java代码来控制Windows XP, 我需要单击/键入 windowsXP 给定窗口的特定按钮/文本字段, 怎么做这个有什么想法吗?
我尝试过的方法是: (1) 我尝试过 AutoIT 框架,但它的 Java Wrapper 有 bug.. 不稳定。
(2) JNA 可用于本机接口,通过使用一些 .dll 文件 达到同样的目的。但我不知道windowsXP使用的是哪个.dll文件。
有人能详细说明一下吗?
我不太清楚哪个是更好的解决方案。 有没有更好的框架可用于此类事情。
谢谢。
I need to get control over Windows of WindowsXP using Java code,
I need to click/type on particular button/textfield of given window of windowsXP,
How to do this any idea?
Approaches I tried are:
(1) I Tried AutoIT framework, but its Java Wrapper is buggy.. not stable.
(2) JNA can be used for native interfacing, by using some .dll file
to achieve the same. But I don't know which .dll file is used by windowsXP.
Can anybody elaborate on this?
I've not much idea which is much better solution.
Is there any better framework available for such thing.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WindowsXP使用多个dll文件,而不是一个,研究它的API会告诉你哪个有哪些功能,然后你可以在你的JNA交互代码中使用这些信息。顺便说一句,我已经使用 AutoIt 本身来帮助完成您想要做的事情,它工作得很好,并且比带有 JNA 的 Java 更容易,因为它是为此类事情而构建的。我还将 AutoIt 与 Java 结合使用,让 Java 调用小型 AutoIt 程序,并通过标准输入和输出流进行一些简单的交互,同时注意这篇精彩文章中的提示和陷阱: javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html" rel="nofollow">当 Runtime.exec() 不会时
WindowsXP uses multiple dll files, not one, and studying its API will tell you which one has which functions, and then you can use this information in your JNA interaction code. BTW, I have use AutoIt by itself to help do what you're trying to do and it works fine, and is easier than Java with JNA since it's built for this sort of thing. I've also used AutoIt with Java by having Java call small AutoIt programs and get some simple interaction via standard input and output streams taking care though of the tips and traps in this great article: When Runtime.exec() won't