Results 1 to 3 of 3

Thread: Get keyboard keyPress

  1. #1
    mamali80 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Jul 2012
    Posts
    1
    Reputation
    0

    Get keyboard keyPress

    Hi,
    I am working on a windows service application that required to get the barcode reader characters and saving the value in database, I have tried some methods like this one:

    Processing Global Mouse and Keyboard Hooks in C# - CodeProject

    But they not working in the windows service app, does anyone knows how can I get the keyboard/barcode reader characters in the windows service?
    Appreciate the help in advance,
    Regards,

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,767
    Reputation
    1702
    I can't see why you would choose to use a Windows Service for that. You should be using a WinForms application.

  3. #3
    Herman is offline VB.NET Forum Idol
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Location
    Montreal, QC, CA
    Posts
    865
    Reputation
    1210
    In order to interact with the keyboard, mouse, or desktop, a service has to be marked as Interactive, and this is frowned upon since Windows Vista. It's still possible to do what you want but it's certainly not the best approach. I have a feeling that any AV program worth a dime would yell out at the sight of a service hooked into global keyboard events.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •