Re: WM_DEVICECHANGE PARAMETERS



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: startup programs load notification;
    ... use a service and register to be notified of session changes, these types of notifications do not exist in kernel mode ... Please do not send e-mail directly to this alias. ...
    (microsoft.public.development.device.drivers)
  • Re: WinUSB: How to tell if the device has gone
    ... register for pnp handle notifications on the HANDLE that you opened with RegisterDeviceNotification. ... you will be told when the usb device has been unplugged ... Please do not send e-mail directly to this alias. ...
    (microsoft.public.windowsxp.device_driver.dev)
  • Re: Surprise removal of keyboard device waking from S3
    ... RegisterDeviceNotification is also used to tell your app when the raw PDO appears as well by registering for device itnerface notifications. ... if you open a handle to a pnp device, you should also register for pnp notifications on that handle to know when the underlying device is going away. ... as to why the usb keyboard is dropping off the bus, it could be a variety of problems, but in the end it does not matter. ...
    (microsoft.public.development.device.drivers)
  • Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING
    ... Please do not send e-mail directly to this alias. ... This posting is provided "AS IS" with no warranties, ... >> registered for device arrival notifications on the GUID, ... >> newsgroup purposes only. ...
    (microsoft.public.development.device.drivers)
  • Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING
    ... Please do not send e-mail directly to this alias. ... >I am now getting notifications on WM_DEVICECHANGE (I'm not sure what ... > making it over to the app in their respective DEV_BROADCAST_HANDLE fields. ... > I've defined the TARGET_DEVICE_CUSTOM_NOTIFICATION buffer as a local (on ...
    (microsoft.public.development.device.drivers)