USB Barcode Scanner and WM_KEYDOWN

扶醉桌前 提交于 2019-12-03 20:29:11

just wanted to add, that microsoft POS.net, a free library from microsoft for building point of service systems, allows you to read most common barcode scanners, and gives you an event when a barcode is scanned. The library is free, and pretty well supported, and works with any barcode scanner that has an OPOS driver.

One non-software solution that could save you a lot of aggravation would be to get the RS-232 cable for this scanner and just read from the COM port. Then you wouldn't need to care which window or control had focus. That particular scanner has a COM port emulation driver, though it probably won't work under Windows 7.

It occurred to me that I don't really need the solution that the article in question solves. After reading over several times i realized that it was meant to handle the situation where you couldn't setup the scanner to use prefix and suffix data. Luckily for me, I can do this.

Otherwise, I chatted with the author of the article and we believe the issue was because I was running Windows 64. I think some of the code uses incorrect datatypes that may cause 64 bit to marshal the data incorrectly... I wasn't able to verify this though.

Was a great exercise in lower level windows programming though. Great resource at pinvoke.net for using interops...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!