VB6 read barcode while program is running in background <p>i have a problem to make a program that can read Barcode. What i want to do is a program (maybe a service? i don't know) that can capture barcode from a barcode scanner while is running in background.</p> <p>I have found that i can check if is plugged in a specific barcode scanner with his VID/PID, here some code:</p> <pre><code>Set wmi = GetObject("winmgmts://./root/cimv2") Dim VID As String Dim PID As String 'Barcode scanner VID = "VID_040B" PID = "PID_6510" 'REV = "REV_0120" For Each d In wmi.ExecQuery("SELECT * FROM Win32_USBControllerDevice") If InStr(d.Dependent, VID &amp; "&amp;" &amp; PID) &gt; 0 Then Debug.Print ("Barcode Scanner found it!") Debug.Print wmi.Get(d.Dependent).Description End If Next </code></pre> <p>How can I do that is read by my program only the input of my barcode scanner?</p> <p>Thank you in advance.</p>