Jump to content

Working with Barcodes!


Recommended Posts

Hi guys! How are you? Hope fine :) I'm working with a barcode reader and I'd like to have the same result on my input in a GUI as I have on an Excel sheet.
Better example:
If I scan the barcode, on the Excel sheet I have a totally different result on a GUI's input. Why? :) Thanks :D 

EDIT: My mistake... The barcode reads and print correctly data, but, the interconnection with EN_CHANGE command, print only 1 character... How can I still use that function, without printing only 1 character? Thanks :) 

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

Post a reproducer, the shorter/simpler the better.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I create the GUI with:
 

Func GUIPrelevaProdotto()
    #Region ### START Koda GUI section ### Form=C:\Users\Portatile-60\Documents\Documenti Lavoro\AutoIt\Gestione Magazzino\form_PrelevaProdotto.kxf
    $form_PrelevaProdotto = GUICreate("form_PrelevaProdotto", 334, 108, @DesktopWidth/2 - 96, @DesktopHeight/2 - 161) ; 192, 124
    $input_CodiceProdotto = GUICtrlCreateInput("input_CodiceProdotto", 16, 48, 305, 21)
    $input_Messaggio = GUICtrlCreateInput("input_CodiceProdotto", 16, 72, 305, 21)
    $label_Titolo = GUICtrlCreateLabel("Preleva Prodotto", 68, 10, 196, 33)
    GUICtrlSetFont(-1, 18, 800, 0, "Arial")
    GUISetState(@SW_SHOW, $form_PrelevaProdotto)
    #EndRegion ### END Koda GUI section ###
EndFunc

I manage my WM_COMMAND with:
 

Func My_WM_COMMAND($hwnd, $msg, $wparam, $lparam)
    If _WinAPI_LoWord($wparam) = $input_CodiceProdotto And _WinAPI_HiWord($wparam) = $EN_KILLFOCUS And GUICtrlRead($input_CodiceProdotto) <> "" Then
        ; Do the research
        PrelevaProdotto()
        GUICtrlSetState($input_CodiceProdotto, $GUI_FOCUS)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc

The func PrelevaProdotto manages the research of the barcode scanned...
It doesn't affect the code that you need :)

I'd like to scan the barcode, and, without touch anything, call the function PrelevaProdotto(), but, as I explained above, I didn't manage to do it with the event $EN_CHANGE, because seems to be too much faster ( it doesn't allow the text to be entered in the input from the barcode scanner ), it only receive 1 character, it's too much fast! Thanks for your reply :)  

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

Drag, I thought the update notification would fire when the update was completed, versus the change notification which fires when a change to text is made (which is probably why you got 1 letter at a time).  

 

What is going on in your PrelevaProdotto function?  How does it read the inputbox?


 

Link to comment
Share on other sites

2 minutes ago, spudw2k said:

Drag, I thought the update notification would fire when the update was completed, versus the change notification which fires when a change to text is made (which is probably why you got 1 letter at a time).  

 

What is going on in your PrelevaProdotto function?  How does it read the inputbox?


 

I added this at the function WM_COMMAND, and works :D 
 

If _WinAPI_LoWord($wparam) = $input_CodiceProdotto And _WinAPI_HiWord($wparam) = $EN_UPDATE And Sleep(250) And GUICtrlRead($input_CodiceProdotto) <> "" Then

Thanks for your help! Stay tuned, please! I need your knowledge! Really thanks! :D 

 

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

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