views:

57

answers:

2

I would like to create small app (in C#) to switch active keyboards and mouses in windows.

For example i have 10 mice and 10 keyboards (in one computer with USB hub) and I would like to ban one or more of these.

Is something like that even possible? I have no clue how to achieve this task.

Any ideas, Thanks!

A: 

I do not know if that's possible...but why 10 keyboards/10 mice? Peculiar! By the sound of it there may be a possible solution to your problem, you need to register a windows global event 'RegisterDeviceNotification' to intercept the plugging and removing of a USB device. The pinvoke signature is here.

See here on CodeProject for an article on 'HIDache', here is another two more links about using the pinvoke to do the job. First link is about USB HID, the other link is about detecting USB drive removable events.

I would imagine that upon plugging in, after the event is received that you can deny the system to use it...

Hope this helps, Best regards, Tom.

tommieb75
As far as i know the client wants to have some kind of training room, where every user can interact with projector screen, but they need tools for managing access for this computer. Ill try tour suggestion and let you know, but i intend to manage keyboards plugged in yet.
Kostkac
A: 

If anybody search for this, here is the solution: http://en.kioskea.net/faq/1886-enable-disable-a-device-from-the-command-line. This let you diasble items vid cmd line.

Kostkac