问题描述
AutoIt 似乎在将焦点分配给 Java 应用程序时停止工作.
AutoIt seems to stop working when focus is given to a java application.
对于此代码:
MouseMove(61, 121, 10);
WinActivate("Main @ paperMoney [build 1800.20]");
MsgBox(0, "got it", "got it");
结果是 --> 鼠标移动,java 应用程序获得焦点并出现消息
Results are --> Mouse moves, java application gets focus and message appears
对于此代码:
WinActivate("Main @ paperMoney [build 1800.20]");
MouseMove(61, 121, 10);
MsgBox(0, "got it", "got it");
结果是 --> java 应用程序获得焦点,鼠标不移动并出现消息.
Results are --> java application gets focus, mouse DOES NOT move and message appears.
在 java 应用程序获得焦点后,我可以做些什么来使鼠标和键盘命令工作?
Is there anything I can do to make the mouse and keyboard commands work after the java application has focus?
推荐答案
考虑到 paperMoney 的作用,它可能是故意抵制自动化.特别是当 Window 被激活时,它会钩入低级鼠标事件并检查所有硬件鼠标移动与实际移动.使用它可以防止任何模拟的鼠标移动.您可以使用 Send 在窗口中键入键吗?
Considering what paperMoney does, it is probably purposely resisting automation. Especially when the Window is activated, it will hook into low-level mouse events and check all hardware mouse movement with actual movement. Using that it will prevent any simulated mouse movement. Can you use Send to type keys in the Window?
这篇关于将 AutoIt 与 Java 应用程序一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!