0

First of all no I'm not writing a keylogger... what I have is a barcode scanner that appears as a keyboard... well I need a way to use the scanner exclusively... this app will run in the background so I need ALL scanned data to scan into my app regardless of what app I'm using..

my guess is to make an invisible form that pops up and has focus when I pull up the screen that I need the barcode scanned..

2 Answers2

1

Please take a look at my answer here How HID devices work when programming?

You can set up your scanner to function as a USB-HID device and capture PDF417 scanned data.

reas
  • 379
  • 1
  • 6
0

Don't know if you need to do anything special. From what I have worked in the past, scanners are not much more than a keyboard wedge device. Whatever field you are in, scan and as long as a simple barcode (code 39, code 128, similar) that are not complex, they should just fill in whatever field you are on.

Now, that being said, if you have a 2d barcode (PDF417), or other complex barcode that has capacity of larger amounts of data, special characters, etc., that you may need to do parsing, that goes an extra level.

If you could also provide maybe the specific device / manufacturer, there might be libraries that you can use to pre-capture the data and parse before sending forward.

FEEDBACK per comment.

I had to do a similar option of licenses, but limited states needed. Only a few states actually provide their specific format. Doing hospitality work, you probably need to cover most states, and probably skip over international and require that.

Also, having to push the results into whatever current app is, currently active, you might be able to capture in the background and push a Windows message of the final decoded to the active application. May need to dig into those API calls more directly.. Good luck, but I'll try to look into possible messaging for you too.

DRapp
  • 47,638
  • 12
  • 72
  • 142
  • yes its 2d barcode (PDF417) scanning guest Drivers License to be exact.. basically making an app to scan guest license to avoid typo's during the checkin process – Christopher Workman Jul 26 '20 at 02:09
  • @ChristopherWorkman, updated answer, comment/direction forward options. Also, what scanning device are you working with... Specific manufacturer / model? Might help me in researching additional stuff for you. – DRapp Jul 27 '20 at 21:10
  • the scanner is an el-cheapo from amazon... NYear NT800-U... I got it working for SC at least by having a small form with a multi-line text box, a timer that forces the form to stay active.. giving you the chance to read ALL data from the barcode... then the form closes.. sending Last Name, First Name, Address, city, state, zip to the MAIN form which then puts it in the right fields in the attached IE Browser.. – Christopher Workman Jul 28 '20 at 00:35
  • problem I seem to have now is my code working one minute and 5 minutes later its not.. solution would work if the IDScanner would popup every time its supposed to.. I think it has something to do with the attached IE Events not firing every time they are supposed to.. – Christopher Workman Jul 28 '20 at 01:01