Setup api and microphone detection

  • Thread starter Thread starter Ram
  • Start date Start date
R

Ram

Hello,
I am trying to detect the USB device arrival and removal. I have
registered to receive the device change message. I am able to get the
interface class and also the name. But I am unable to get the type of class.
IE when a microphone is inserted, I am trying to find whether the newly
inserted device is a kind of "sound, video and game controller" and if yes
then I am refreshing my application.

None of the setpdigetregistryproperty is returning me this string. How to
get this?

Thanks
Ram
 
Hi Ram,

i once wrote a application to detect device changes on my system.
The code is written on the fly and is not very "clean" but runs stable.
I only tested it on windows XP systems but it was usefull for my
work. It was a demonstration how to implement a device watcher
in Visual C++ (6.0) for my programming class. You can easily
translate it into C#, it should be no match to do this:

http://entwicklung.junetz.de/projects/opensource/teaching/examples/DeviceWatcher.zip

Hope this helps,...


Regards

Kerem


--
 
Hi Kerem,
Thank you very much. I have solved it. The problem was that, I thought
only one event will be fired when an usb object is inserted but later I
could find for each guid, am getting the event. So after getting the usb
guid, I am getting the correct device class and description.

Also, In XP, the SDRP_LOCATION from SetupDiGetDeviceRegistryProperty (),
returns the device name (for eg, Logitech, Microsoft Live Chat etc ) but in
Vista, the location information is different. What it is the difference?

Thanks again

Ram
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top