• I removed the www from the URL, please update your bookmarks and pay attention to the bottom of the screen if using Google Chrome to allow push notifications again.

Question Get keyboard keyPress

mamali80

New member
Joined
Jul 21, 2012
Messages
1
Programming Experience
Beginner
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,
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,061
Location
Sydney, Australia
Programming Experience
10+
I can't see why you would choose to use a Windows Service for that. You should be using a WinForms application.
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
873
Location
Montreal, QC, CA
Programming Experience
10+
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.
 
Top Bottom