Reputation: 10850
I am writing an application which detects if any bar-code scanner is attached to the pc or not. I don't know how to query the installed devices to check for barcode scanners. I am using C# and .NET 4.0.
Upvotes: 0
Views: 3810
Reputation: 6442
You probably want to use WMI...
Heres some CodeProject links that might help.
http://www.codeproject.com/Articles/18268/How-To-Almost-Everything-In-WMI-via-C-Part-3-Hardw
http://www.codeproject.com/Articles/21503/Hardware-Helper-Library-for-C
Upvotes: 1
Reputation: 7491
Some barcode scanner are attached by keyboard wedge (Or their drivers report them as keyboards) - I believe there is no way to test if these are present.
Other specific scanners may be accessible through their USB ports but any status query will have to be on a model by model basis.
Upvotes: 3