Barcode Reader Application -- HELP

N

neilphan

Hi all,

I have an application that uses input from a barcode reader via a USB
port. My application works fine only if the application HAS FOCUS.
If the user opens up another application (not mines) such as
notepad/word, etc, the Barcode Reader reads data into the applicaton
that currently has focus with is notepad/word but not my own
applicaton.

My question is as follows: Is there a way to write a Listener
Class/Windows Service to ALWAYS direct the Data that the barcode reader
reads in into my own application even though it does not have focus?

The reason that i'm doing this is to be able to provide 2 users using
the same machine...One user used the BarCode Scanner and the other
person can still use the computer to work on aother applications.

Much Thanks,
Neil
 
K

Ken Halter

Hi all,

I have an application that uses input from a barcode reader via a USB
port. My application works fine only if the application HAS FOCUS.

No help here... just mentioning that "who ever" wrote the interface for that
utility/driver was a complete nut and it probably came from the same place
the VB6 version did... which worked the exact same way. Silly. Thankfully,
I've only had to "read" about the problems instead of actually experiencing
them (wonder if the author of that utility/driver ever heard the term
"multi-tasking")
 
K

Kay-Christian Wessel

I think you use the barcode-keyboard-emulator which sends the barcodes as
keystrokes to the active application.

What you need is a dll which gives you events when a barcode is scanned.
Look for a SDK for your scanner.

Best regards
Kay
 
S

Steve

Generally barcode scanners can be configured to send an ascii control code
at the start and or the end of a scanning sequence (Check the user manual)
what you have to do is write a global keyboard message hook to watch the
beginniing and ending characters of a scan (And capture all in between). An
example of vb code for a keyboard hook can be found here
http://www.freevbcode.com/ShowCode.asp?ID=728


Steve Hall
 
D

Dick Grier

Hi,

IMO, there is no good way to do this.

So, my recommendation it to use a scanner with a serial interface. Then,
there is no such problem. All barcode reader manufacturers provide models
with RS-232 serial interfaces for just this reason. If you have to use it
with a PC that has only a USB interface, you still have the option of adding
a serial UAB adapter.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
See www.hardandsoftware.net for details and contact information.
 
N

neilphan

Hi Steve, Dick,

I really appreciate both of your help and input.

Steven, keyboard hook approach would probably be the easiest though
there is a side effect to this approach. When I've tried the sample
application via the download, the hook even works fine...but it places
the INPUT in BOTH Application.
My main goal is to "Redirect" the input of the scanner to one
application reguardless if it has focus or not, in foregroud or
background.

Dick, your approach seems very plausible but I have never programmed on
I/O devices other than Mouse/Keyboard. So i'm not sure if I could
"preformed" the code nessecary to do this type of I/O redirection.

Thanks Guys!!!

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top