Jump to content

Barcode Scan Detection


p90x
 Share

Recommended Posts

I have and application that is running and is can recognize 2d barcodes. So even when the app is not the top focus application it will become the top app as soon as the scan happens. My problem is when the app is not top  focus and someone scans a 1D barcode the app does not respond. Any ideas on maybe solving this>?

Link to comment
Share on other sites

  • Moderators

@p90x welcome to the forum. Are these applications written in AutoIt? If so, how about posting the code? Otherwise, you're asking us to first guess at what you're trying to do and then help you troubleshoot. Help us help you ;)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I've had to deal with a similar issue where I work. I wrote a little script that listens for a HotKey that would be "typed" by the barcode scanner. The barcode scanner you have seems to be like mine in that it basically emulates keyboard entry, at least for 1D. The 1D scanner I have will only scan a barcode if it is 3 characters or longer, so I printed out a barcode that typed /// when scanned. My script, upon seeing /// being "typed", would activate the window I needed scan into.

HotKeySet("/", "Command")

While 1
    Sleep(100)
WEnd

Func Command()
WinActivate ("WindowToScanInto")
ControlFocus ( "WindowToScanInto", "", CertainControlID )
;Uncomment the above line if you need to activate a particular control.
EndFunc

 

Link to comment
Share on other sites

Theultrahead  Thanks so much. Let me give this a try.

This is the format of the barcode that I'm scanning:

\`0100361553364651\`

How do I mod your code, Sorry I just started using autoIT for the first time when I posted the original message.

 

Edited by p90x
Link to comment
Share on other sites

I've had to deal with a similar issue where I work. I wrote a little script that listens for a HotKey that would be "typed" by the barcode scanner. The barcode scanner you have seems to be like mine in that it basically emulates keyboard entry, at least for 1D. The 1D scanner I have will only scan a barcode if it is 3 characters or longer, so I printed out a barcode that typed /// when scanned. My script, upon seeing /// being "typed", would activate the window I needed scan into.

HotKeySet("/", "Command")

While 1
    Sleep(100)
WEnd

Func Command()
WinActivate ("WindowToScanInto")
ControlFocus ( "WindowToScanInto", "", CertainControlID )
;Uncomment the above line if you need to activate a particular control.
EndFunc

 

Theultrahead  Thanks so much. Let me give this a try.

This is the format of the barcode that I'm scanning:

\`0100361553364651\`

How do I mod your code, Sorry I just started using autoIT for the first time when I posted the original message.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...