-
It is certainly much easier to use GUID_DEVCLASS_MEDIA. OR convert the string to a guid with any number of built in functions so that you get the order in the Data4 array correct
-
That is a device class, not a device interface. Device class defines pretty UI things like icons, not how the device works.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Madhusudan Narayan
Sent: Tuesday, February 16, 2010 11:07 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Win7. WM_DEVICECHANGE:: DBT_DEVICEARRIVAL Vs DBT_DEVNODES_CHANGED.
I have used the guid (“4d36e96c-e325-11ce-bfc1-08002be10318”).
This is how I am doing it
DEV_BROADCAST_DEVICEINTERFACE dev;
dev.dbcc_devicetype=DBT_DEVTYP_DEVICEINTERFACE;
//dev.dbcc_classguid;//uuid(“4d36e96c-e325-11ce-bfc1-08002be10318”);
dev.dbcc_classguid.Data1=0x4d36e96c;
dev.dbcc_classguid.Data2=0xe325;
dev.dbcc_classguid.Data3=0x11ce;
dev.dbcc_classguid.Data4[0]=0xbf;
dev.dbcc_classguid.Data4[1]=0xc1;
dev.dbcc_classguid.Data4[2]=0x08;
dev.dbcc_classguid.Data4[3]=0x00;
dev.dbcc_classguid.Data4[4]=0x2b;
dev.dbcc_classguid.Data4[5]=0xe1;
dev.dbcc_classguid.Data4[6]=0x03;
dev.dbcc_classguid.Data4[7]=0x18;
dev.dbcc_size=sizeof(DEV_BROADCAST_DEVICEINTERFACE);
Tried with both
RegisterDeviceNotification(hInstance,&dev,DEVICE_NOTIFY_WINDOW_HANDLE);
and
RegisterDeviceNotification(hInstance,&dev,DEVICE_NOTIFY_WINDOW_HANDLE|DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);
None of these worked
On Wed, Feb 17, 2010 at 12:21 PM, Doron Holan > wrote:
Did you call RegisterDeviceNotification with the appropriate device interface guid?
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Madhusudan Narayan
Sent: Monday, February 15, 2010 11:02 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Win7. WM_DEVICECHANGE:: DBT_DEVICEARRIVAL Vs DBT_DEVNODES_CHANGED.
Hi All,
this is a query on the Windows messages.
My app needs to know when new device is added(specifically a audio output device) is added.
So I supposed, my window message handler can use the WM_DEVICECHANGE, and DBT_DEVICEARRIVAL.
But the app is receiving only DEVNODES_CHANGED all the time.
why is this? What is the best approach to be notified of new audio devices added? Please advise.
Regards,
Madhusudhana
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>