按键事件查看器 [英] Keystroke event viewer

查看:71
本文介绍了按键事件查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是捕获条形码扫描,以查看字符串是否包含设置值,然后包含ID.我们的工作站利用多个接口,而捕获扫描的适当接口并不总是很重要.我当时在考虑使用后台应用程序来监视特定字符串,然后运行查询.

如果您知道要使用比按键应用程序更好的应用程序,请提出建议.

在此先感谢您.

My goal is to capture a barcode scan to see if the string contains a set value and then the ID. Our workstations utilize multiple interfaces and the proper interface to capture the scan is not always focused. I was thinking of having a background app to watch for a paticular string and then run a query.

If you know of a better app to use then a keystroke app, please advise.

Thanks in advance.

推荐答案

如果我对您的理解正确,那么要做的是引发一个事件,在进行扫描时传递条形码数据. GUI应该通过显示所需的相关UI对事件做出反应.
扫描程序侦听器"可能需要在单独的线程上运行(以避免阻塞UI),而不是其自己的应用程序.就是说,如果Scanner API具有可以挂接到的事件,则可能不需要线程.


显示所需窗口的方法取决于您要执行的操作以及窗口的隐藏"方式,如果您的表单已经打开,则可以在表单的事件处理程序中为扫描的事件提供帮助
If I understand you correctly, the thing to do is to raise an event, passing the barcode data when a scan is made. The GUI should react to the event by showing the relevant UI you want.
The scanner "listener" might need to run on a separate thread (to avoid blocking the UI), not its own application. That said, you might not need a thread if the Scanner API has an event you can hook in to.


The method of showing the window you need is dependant on what you want to do and how the window is "hidden", if your form is already open this might help, in the form''s eventhandler for the scanned event
TopMost = true;
Focus();
BringToFront();



最后一件事,服务是为长时间运行的流程而准备的,它们没有[不能!] UI.获取进程间通信(远程)相对比较杂乱,可能不需要.我建议您将UI应用程序设置为系统托盘(有关指导,请参见



One final thing, services are meant to be for long running processes, they don''t [can''t!] have UIs. Getting the inter-process communications (remoting) is relatively messy, and probably not needed. I suggest you make your UI app a syst tray one (For guidance see this website[^]). This way you start your app, it minimises itself into the system tray and when the scanner raises the "CodeRead" event you can unminise the UI and it should have focus (if not the code above should sort this). Once the user is done, the app can be re-minimised neatly into the systray.


Kieth,您是正确的.您对如何强制使GUI集中有什么建议或指导,我可以继续下去吗?我知道VB.net.
Windows服务会很好,但是我无法完成一项工作.

预先感谢.
Kieth, you are correct. Do you have any advice or a direction I can go on of how to force the GUI to be focused? I know VB.net.
A windows service would be nice but I have been unsuccessful in making one work.

Thanks in advance.


这篇关于按键事件查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆