使用 JNA 和 Windows sendMessage API 从基于 java 的 Web 应用程序更改 Windows XP 中的焦点窗口
我想知道是否有人有使用 JNA 从浏览器中运行的 java Web 应用程序调用 windows sendMessage API 的经验,以将焦点从浏览器更改为已在计算机上运行的另一个程序。
我正在构建一个零件目录,一旦用户选择了他们想要出售给客户的零件,我需要自动打开销售点系统,以便员工可以进行交易。他们希望这种情况发生在零件目录中的某些事件上,而不仅仅是 ALT-Tab 或类似的东西。我相信收银机运行某种 kiosk 版本的 XP 和浏览器(可能是 Firefox 5),因此某些功能(例如任务栏和开始菜单等)不存在。也许 JNA 和 windows API 是完全错误的方式。任何帮助或指导将不胜感激!
I'm wondering if anyone has any experience using JNA to call windows sendMessage API from a java web application running in a browser to change the focus from the browser to another program that is already running on the computer.
I'm building out a Parts catalog that once the user has chosen the parts they want to sell to the customer, I need to automatically open the Point of Sale system so that the employee can tender the transaction. They want this to happen on some event in the parts catalog, not just an ALT-Tab or something similar. I believe the registers run some sort of kiosk version of XP and the browser (Probably going to be Firefox 5), so some of the functionality, like the task bar and start menu, etc. are not there. Maybe JNA and the windows API is the wrong way completely. Any help or direction would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种简单的方法是枚举现有窗口,直到找到您要查找的窗口,然后调用适当的 win32 方法来直接激活/聚焦该窗口。
A straightforward method would be to enumerate the extant windows until you find the one you're looking for, and then invoke the appropriate win32 method to activate/focus that window directly.