Re: WM_DEVICECHANGE PARAMETERS



Hi,
I need to monitor several types of devices at the same time :
- keyboard (not all HID's)
- Comports
- Disks

Can I register multiple times for this ?

Greetings,
Rob.


"Doron Holan [MSFT]" wrote:

you need to register with a specific device interface. this tells you the
type of device. once you have the devicce instance path on the arrival
notification you can use setupdi to open up the properties for the device
and read the "ComPort" property (for a COM port)

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Rob" <Rob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@xxxxxxxxxxxxxxxx
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


.



Relevant Pages

  • Re: Correct Semaphore Implementation in Java
    ... It re-acquires the monitor, FAILS to check ... > notification, or that the thread receiving the notification is ... receiving notify does not imply that the waiting condition has been met. ...
    (comp.lang.java.programmer)
  • Re: Remote notification of presubmission queue exceeding set value?
    ... Why don't you use the script notification feature in ESM, ... > method of being remotely notified if the queue exceeds a set amount, ... when the SMTP service is plugged!? ... > I thought about getting another vendor's event log monitor that has it's ...
    (microsoft.public.exchange.admin)
  • Re: [LH] Yep, thats all it took!
    ... > not via web) if the notification comes to the email box before ... It is almost assured that eB*y does monitor Usenet directly, ... Then I used the word eB*y in a Finnish test newsgroup: ... Or you can try to use the test groups of different ...
    (rec.music.gaffa)
  • Re: Remote notification of presubmission queue exceeding set value
    ... This means either paging or emailing my cell phone. ... > Why don't you use the script notification feature in ESM, ... >> method of being remotely notified if the queue exceeds a set amount, ... >> I thought about getting another vendor's event log monitor that has it's ...
    (microsoft.public.exchange.admin)

Loading