Is there a way to detect when a specific device is plugged into a usb port, what I would like to happen is when I plug my laptop into my docking station it run up several apps to account for my different keyboard, mouse and monitors. Specifically I have an issue with some software for my G15 keyboard stopping media player closing properly.
Hopefully in .NET but if not any suggestions appreciated.
Try using SharpUSBLib. It’s a C# wrapper around the libusb project.
I’m pasting a code sample below (included in the download – just tried it myself). It seems simple enough and I think it will provide you with quite lot of info on devices connected to your laptop via USB.