RE: WM_DEVICECHANGE PARAMETERS



Hi,
I also had the problem that LParam is 0.
See codefragment below for the right (?) way to register, in order to solve
that.

My problem is that when I plug in a device (like a COMPORT) I would like to
know 2 things :
1) WHat kind of device was plugged (comport, I need the IF-GUID I think)
2) What it's devicename is (Like COM1:)

This seems impossible without to determine from the notification-info.
See : http://69.10.233.10/KB/cs/HardwareHelper.aspx
and : http://www.codeproject.com/KB/system/HwDetect.aspx?display=PrintAll

monitoring the entire devicelist seems the only option.
I hope I'm wrong about this.

Any tips ?


//****** CODE fragment: ******

DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
GUID tmp={0,0,0,""};
ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );

NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
NotificationFilter.dbcc_classguid = tmp;

m_hDevNotify = RegisterDeviceNotification(m_hWnd ,&NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE|DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);

//****** end CODE fragment: ******



Greetings,
Rob.




"rseedle" wrote:

I am recieving the plug in / unplug events correctly but the WPARAM always
has a 7 in it. If I understand correctly the WPARAM should specify the values

DBT_DEVICEARRIVAL 0x8000
and
DBT_DEVICEREMOVECOMPLETE 0x8004

What is up with that ?

Randy Seedle
.


Loading