Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. USB Port

USB Port

Scheduled Pinned Locked Moved C#
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahin77
    wrote on last edited by
    #1

    :confused:Hi, I have to write a program to capture a usb barcode scanner,... as you all know, when you scan a barcode, it acts like a keyboard & just sends the barcode text to the active window. all i have to do is just to write a program which runs in the background & captures those scanned barcodes to a text file and it would not sent it to the active window,.. it's like windows message intercepting for your own purpose. i really apprecite if you can give me any sample code, or any clue. Thanks in advance

    E D 2 Replies Last reply
    0
    • S Shahin77

      :confused:Hi, I have to write a program to capture a usb barcode scanner,... as you all know, when you scan a barcode, it acts like a keyboard & just sends the barcode text to the active window. all i have to do is just to write a program which runs in the background & captures those scanned barcodes to a text file and it would not sent it to the active window,.. it's like windows message intercepting for your own purpose. i really apprecite if you can give me any sample code, or any clue. Thanks in advance

      E Offline
      E Offline
      eggie5
      wrote on last edited by
      #2

      You say it's acting like a keyboard, are you implying that it's using a generic Micorosoft Human Interface Driver? /\ |_ E X E GG

      S 1 Reply Last reply
      0
      • E eggie5

        You say it's acting like a keyboard, are you implying that it's using a generic Micorosoft Human Interface Driver? /\ |_ E X E GG

        S Offline
        S Offline
        Shahin77
        wrote on last edited by
        #3

        yes i think so, i didn't install any driver, by theway i have windows xp pro sp2. it should be same as the usb keyboards.

        E 2 Replies Last reply
        0
        • S Shahin77

          yes i think so, i didn't install any driver, by theway i have windows xp pro sp2. it should be same as the usb keyboards.

          E Offline
          E Offline
          eggie5
          wrote on last edited by
          #4

          Well then you can use some already documented APIs to interface with your device. I will post more details the open of business Monday. /\ |_ E X E GG

          1 Reply Last reply
          0
          • S Shahin77

            :confused:Hi, I have to write a program to capture a usb barcode scanner,... as you all know, when you scan a barcode, it acts like a keyboard & just sends the barcode text to the active window. all i have to do is just to write a program which runs in the background & captures those scanned barcodes to a text file and it would not sent it to the active window,.. it's like windows message intercepting for your own purpose. i really apprecite if you can give me any sample code, or any clue. Thanks in advance

            D Offline
            D Offline
            Daniel Turini
            wrote on last edited by
            #5

            Search the web (or codeproject) for keyboard hook, and you'll find what you look for. But probably it'll be hard to find something in C#, it's something that easier done in C++. I see dead pixels Yes, even I am blogging now!

            1 Reply Last reply
            0
            • S Shahin77

              yes i think so, i didn't install any driver, by theway i have windows xp pro sp2. it should be same as the usb keyboards.

              E Offline
              E Offline
              eggie5
              wrote on last edited by
              #6

              check this out http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx[^] /\ |_ E X E GG

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups