Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2007

Tip: Looking for answers? Try searching our database.

Setup api and microphone detection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ram - 01 Dec 2007 06:14 GMT
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
Kerem Gümrükcü - 01 Dec 2007 14:38 GMT
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

Signature

-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

Ram - 01 Dec 2007 18:08 GMT
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

> Hi Ram,
>
[quoted text clipped - 12 lines]
>
> Kerem

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.