I am developing a Windows Form Application using Visual
Studio.NET using the C# language. The application will
run on a "standard" PC that is running Windows XP. The PC
has a USB hub with two device connectors.

I need to be able to detect when a keyboard and/or mouse
is connected/disconnected to/from the USB ports.

How can I do this? Are there system events for this?

the code can be in C or vb.net too

I don't know if you've posted in other forums, but Java cannot give you the things you are looking for... that's the job of the operating system itself, and that generally means you need to write it in C (which you can then link in to Java via JNI, if you really must do so).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.