Get keyboard keyPress
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,
I can't see why you would choose to use a Windows Service for that. You should be using a WinForms application.
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