Re: WM_DEVICECHANGE PARAMETERS



Hi,
Thanks, I'll try that first thing tomorrow.

I assume you mean this is done by calling the register function multiple
times with differrent GUIDS, and I assume that the resulting WM_DEVICECHANGE
will have usefull info then ? (if I register for "all classes" I just get
class guids, but if I register for keyboard I should get the keyboard guid in
the response ?) , Right ?

Do you happen to know where I can find the devicename of the inserted device
?
I did see a sample where some long , very cryptic devicename was retrieved,
but not the short form like KBD1:,COM1: etc...

Greetings,
Rob.





"Doron Holan [MSFT]" wrote:

yes, of course you can register for multiple notifications. for keyboards
you should GUID_DEVINTERFACE_KEYBOARD, not the HID guid.

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:0153784F-2B33-43C4-B915-C121014F7BE5@xxxxxxxxxxxxxxxx
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: Cant view merge agent properties (trying again)
    ... The managers ... of that team are on that alias and will get back to you fairly quickly. ... When you successfully register we attempt to popup a page with more ... posting using is, not the address you used for this post. ...
    (microsoft.public.sqlserver.replication)
  • Re: WM_DEVICECHANGE PARAMETERS
    ... one of the drivers is enable the COM port device interface, the other is not. ... Please do not send e-mail directly to this alias. ... but if I register for keyboard I should get the keyboard> guid ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH v2] iw_cxgb3: Support "iwarp-only" interfaces to avoid 4-tuple conflicts.
    ... rdma stack. ... What about providing error back to caller and fail to register? ... device _when_ we get at least one ethX:iwY interface created? ... Maybe you should automatically create an alias each time new interface ...
    (Linux-Kernel)
  • Re: WM_DEVICECHANGE PARAMETERS
    ... Please do not send e-mail directly to this alias. ... Just the notification is giving me trouble. ... I assume you mean this is done by calling the register function ... but if I register for keyboard I should get the keyboard ...
    (microsoft.public.development.device.drivers)
  • Re: PCI Express Enumeration
    ... If I register GUIDs, I'm ... process io on the hardware, all it does is change the FileName that you ... One of the things the driver does is optionally to collapse multiple ...
    (microsoft.public.development.device.drivers)

Loading