Barcode Reader Application -- HELP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • neilphan@gmail.com

    #1

    Barcode Reader Application -- HELP

    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

  • Ken Halter

    #2
    Re: Barcode Reader Application -- HELP

    <neilphan@gmail .com> wrote in message
    news:1140029684 .672167.124510@ z14g2000cwz.goo glegroups.com.. .[color=blue]
    > 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.[/color]

    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..


    Comment

    • Kay-Christian Wessel

      #3
      Re: Barcode Reader Application -- HELP

      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

      <neilphan@gmail .com> skrev i melding
      news:1140029684 .672167.124510@ z14g2000cwz.goo glegroups.com.. .[color=blue]
      > 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
      >[/color]


      Comment

      • Steve

        #4
        Re: Barcode Reader Application -- HELP

        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


        <neilphan@gmail .com> wrote in message
        news:1140029684 .672167.124510@ z14g2000cwz.goo glegroups.com.. .[color=blue]
        > 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
        >[/color]


        Comment

        • Dick Grier

          #5
          Re: Barcode Reader Application -- HELP

          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.


          Comment

          • neilphan@gmail.com

            #6
            Re: Barcode Reader Application -- HELP

            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

            Comment

            Working...