By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,693 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,693 IT Pros & Developers. It's quick & easy.

Barcode Reader Application -- HELP

P: n/a
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

Feb 15 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
<ne******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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")

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Feb 15 '06 #2

P: n/a
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

<ne******@gmail.com> skrev i melding
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Feb 15 '06 #3

P: n/a
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
<ne******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Feb 17 '06 #4

P: n/a
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.
Feb 17 '06 #5

P: n/a
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

Feb 17 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.