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

Re: WM_DEVICECHANGE PARAMETERS by Farhan

Farhan
Thu Oct 18 17:53:56 PDT 2007

Could you share more information about what you are registering for and with
what flags?

And also, do you mean 0x7 or 7 in base 10? 0x0007 is DBT_DEVNODES_CHANGED
and is broadcast to all window handles regardless of whether they are
registered for device notifications or not (for compatibility with 9x).

Thanks,

Farhan

"rseedle" <rseedle@discussions.microsoft.com> wrote in message
news:455DA823-0523-4626-8ABE-627696174559@microsoft.com...
> 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


Re: WM_DEVICECHANGE PARAMETERS by Farhan

Farhan
Fri Oct 19 07:29:16 PDT 2007

I just realized that my question about the base seems quirky :) What I meant
to ask was when you say that WPARAM always has a 7 in it, do you mean the
value is exactly 7, or if the hex representation contains a 7 somewhere in
it?

Regardless, it seems pretty likely that you are receiving the
DBT_DEVNODES_CHANGED notification.

Farhan

"Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote in message
news:#JsZHqeEIHA.3548@TK2MSFTNGP06.phx.gbl...
> Could you share more information about what you are registering for and
> with what flags?
>
> And also, do you mean 0x7 or 7 in base 10? 0x0007 is DBT_DEVNODES_CHANGED
> and is broadcast to all window handles regardless of whether they are
> registered for device notifications or not (for compatibility with 9x).
>
> Thanks,
>
> Farhan
>
> "rseedle" <rseedle@discussions.microsoft.com> wrote in message
> news:455DA823-0523-4626-8ABE-627696174559@microsoft.com...
>> 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
>

Re: WM_DEVICECHANGE PARAMETERS by rseedle

rseedle
Fri Oct 19 11:51:02 PDT 2007

This is a USB product. It uses Silicon Labs CP2102 communications
microcontroller. It is registered with a GUID which is specific to Silicon
Labs. The WPARAM is 0x7. The registration function looks like this.

void USB_event::RegisterNotification()
{
DEV_BROADCAST_DEVICEINTERFACE devIF = {0};
devIF.dbcc_size = sizeof(devIF);
devIF.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
devIF.dbcc_classguid = GUID_INTERFACE_CP210x; //MY_DEVICE_GUID;
m_hNotifyDevNode = RegisterDeviceNotification(window_ptr->winId(),
&devIF, DEVICE_NOTIFY_WINDOW_HANDLE);
}

The GUID looks like this:
DEFINE_GUID(GUID_INTERFACE_CP210x, 0x993f7832, 0x6e2d, 0x4a0f, 0xb2, 0x72,
0xe2, 0xc7, 0x8e, 0x74, 0xf9, 0x3e);

Randy Seedle



"Farhan Ahmed [MSFT[" wrote:

> I just realized that my question about the base seems quirky :) What I meant
> to ask was when you say that WPARAM always has a 7 in it, do you mean the
> value is exactly 7, or if the hex representation contains a 7 somewhere in
> it?
>
> Regardless, it seems pretty likely that you are receiving the
> DBT_DEVNODES_CHANGED notification.
>
> Farhan
>
> "Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote in message
> news:#JsZHqeEIHA.3548@TK2MSFTNGP06.phx.gbl...
> > Could you share more information about what you are registering for and
> > with what flags?
> >
> > And also, do you mean 0x7 or 7 in base 10? 0x0007 is DBT_DEVNODES_CHANGED
> > and is broadcast to all window handles regardless of whether they are
> > registered for device notifications or not (for compatibility with 9x).
> >
> > Thanks,
> >
> > Farhan
> >
> > "rseedle" <rseedle@discussions.microsoft.com> wrote in message
> > news:455DA823-0523-4626-8ABE-627696174559@microsoft.com...
> >> 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
> >

Re: WM_DEVICECHANGE PARAMETERS by Farhan

Farhan
Fri Oct 19 14:54:47 PDT 2007

Yes, as I mentioned, 0x7 is DBT_DEVNODES_CHANGED and is broadcast to all
window handles regardless of registration state (you'll get it even if you
don't register using RegisterDeviceNotification()).

More about it here:
http://msdn2.microsoft.com/en-us/library/aa363211.aspx

You can just ignore this message if it's not interesting to you.

Thanks,

Farhan

"rseedle" <rseedle@discussions.microsoft.com> wrote in message
news:0D9C2939-89C4-43EC-95FA-E64D5C835691@microsoft.com...
> This is a USB product. It uses Silicon Labs CP2102 communications
> microcontroller. It is registered with a GUID which is specific to Silicon
> Labs. The WPARAM is 0x7. The registration function looks like this.
>
> void USB_event::RegisterNotification()
> {
> DEV_BROADCAST_DEVICEINTERFACE devIF = {0};
> devIF.dbcc_size = sizeof(devIF);
> devIF.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
> devIF.dbcc_classguid = GUID_INTERFACE_CP210x; //MY_DEVICE_GUID;
> m_hNotifyDevNode = RegisterDeviceNotification(window_ptr->winId(),
> &devIF, DEVICE_NOTIFY_WINDOW_HANDLE);
> }
>
> The GUID looks like this:
> DEFINE_GUID(GUID_INTERFACE_CP210x, 0x993f7832, 0x6e2d, 0x4a0f, 0xb2, 0x72,
> 0xe2, 0xc7, 0x8e, 0x74, 0xf9, 0x3e);
>
> Randy Seedle
>
>
>
> "Farhan Ahmed [MSFT[" wrote:
>
>> I just realized that my question about the base seems quirky :) What I
>> meant
>> to ask was when you say that WPARAM always has a 7 in it, do you mean the
>> value is exactly 7, or if the hex representation contains a 7 somewhere
>> in
>> it?
>>
>> Regardless, it seems pretty likely that you are receiving the
>> DBT_DEVNODES_CHANGED notification.
>>
>> Farhan
>>
>> "Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote in message
>> news:#JsZHqeEIHA.3548@TK2MSFTNGP06.phx.gbl...
>> > Could you share more information about what you are registering for and
>> > with what flags?
>> >
>> > And also, do you mean 0x7 or 7 in base 10? 0x0007 is
>> > DBT_DEVNODES_CHANGED
>> > and is broadcast to all window handles regardless of whether they are
>> > registered for device notifications or not (for compatibility with 9x).
>> >
>> > Thanks,
>> >
>> > Farhan
>> >
>> > "rseedle" <rseedle@discussions.microsoft.com> wrote in message
>> > news:455DA823-0523-4626-8ABE-627696174559@microsoft.com...
>> >> 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
>> >

Re: WM_DEVICECHANGE PARAMETERS by Tim

Tim
Sat Oct 20 17:12:49 PDT 2007

"Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote:
>
>And also, do you mean 0x7 or 7 in base 10?

He probably meant 7 in octal.

Sorry, couldn't resist.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: WM_DEVICECHANGE PARAMETERS by mooni

mooni
Mon Mar 17 02:33:01 CDT 2008

Well,

I am also getting same problem. Whenever I plugin my USB device I get
WM_DEVICECHANGE successfully but its wParam contains 0x00000007 and lParam is
0x00000000.
I am using device driver of LIBUSB and I've registered for notification also.

DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;

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

hdevnotify =
RegisterDeviceNotification(hwnd, &NotificationFilter,
DEVICE_NOTIFY_WINDOW_HANDLE);

Any one who can help me?


"Tim Roberts" wrote:

> "Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote:
> >
> >And also, do you mean 0x7 or 7 in base 10?
>
> He probably meant 7 in octal.
>
> Sorry, couldn't resist.
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>

Re: WM_DEVICECHANGE PARAMETERS by mooni

mooni
Mon Mar 17 04:52:01 CDT 2008

Well,

I am also getting same problem. I am using LibUSB driver. The problem I am
getting is that whenever I plugin my USB device, I recieve DM_DEVICECHANGED
even but wParam contains 0x00000007 and lParam is 0x00000000. I am
registering notification of these events and code I am using is as follows

DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;

ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
NotificationFilter.dbcc_classguid = GUID_CLASS_VHCTRL;

hdevnotify =
RegisterDeviceNotification(hwnd, &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
Anyone who can help me?

-Taimoor

"Tim Roberts" wrote:

> "Farhan Ahmed [MSFT]" <farhanah@online.microsoft.com> wrote:
> >
> >And also, do you mean 0x7 or 7 in base 10?
>
> He probably meant 7 in octal.
>
> Sorry, couldn't resist.
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>

Re: WM_DEVICECHANGE PARAMETERS by chris

chris
Mon Mar 17 12:27:44 CDT 2008

On Mar 17, 2:33 am, mooni <mo...@discussions.microsoft.com> wrote:

> I am using device driver of LIBUSB and I've registered for notification also.

My advice is to dump libusb and use WinUSB.

RE: WM_DEVICECHANGE PARAMETERS by Rob

Rob
Fri Jun 13 03:58:01 CDT 2008

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

Re: WM_DEVICECHANGE PARAMETERS by Doron

Doron
Fri Jun 13 16:52:14 CDT 2008

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@discussions.microsoft.com> wrote in message
news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
> 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


Re: WM_DEVICECHANGE PARAMETERS by Rob

Rob
Fri Jun 13 17:21:00 CDT 2008

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@discussions.microsoft.com> wrote in message
> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
> > 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
>
>

Re: WM_DEVICECHANGE PARAMETERS by Doron

Doron
Mon Jun 16 15:42:24 CDT 2008

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@discussions.microsoft.com> wrote in message
news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
> 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@discussions.microsoft.com> wrote in message
>> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
>> > 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
>>
>>


Re: WM_DEVICECHANGE PARAMETERS by Rob

Rob
Mon Jun 16 16:53:28 CDT 2008

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@discussions.microsoft.com> wrote in message
> news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
> > 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@discussions.microsoft.com> wrote in message
> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
> >> > 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
> >>
> >>
>
>

Re: WM_DEVICECHANGE PARAMETERS by Doron

Doron
Tue Jun 17 13:07:26 CDT 2008

the device arrival message will include the device interface GUID and will
include the symbolic link name to the device.

WM_DEVICECHANGE
http://msdn.microsoft.com/en-us/library/aa363205(VS.85).aspx

DEV_BROADCAST_DEVICEINTERFACE Structure
http://msdn.microsoft.com/en-us/library/aa363244(VS.85).aspx

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@discussions.microsoft.com> wrote in message
news:28F01714-9D35-408B-A3DF-4E63C8C46AE9@microsoft.com...
> 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@discussions.microsoft.com> wrote in message
>> news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
>> > 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@discussions.microsoft.com> wrote in message
>> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
>> >> > 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
>> >>
>> >>
>>
>>


Re: WM_DEVICECHANGE PARAMETERS by Rob

Rob
Tue Jun 17 14:00:02 CDT 2008

Hi,
Thanks for your tips.
I got it working for the devices I mentioned, by just registerring for
keyboards.
Disks and ports are an exception, and are always notified "with data".

Unfortunately the custom USB-comport-device thats produced in-house by the
company I work for, somehow is not the same as another USB-COM device I have.
They both appear in devicemanager under ports (class), and are both shown by
XP as a comport (deviceinterface ?) .

The custom (self-built) device however, does not produce a notification
"with data", as the other (bought) device does. The device programmer tells
me that the device has the following properties (part of descriptor):

0x02, /* bcdUSB = 2.00 */
0x02, /* bDeviceClass: CDC */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */

Any idea what could be wrong here ?
Strange that in XP-devicemanager, and under WinCE everything is OK.
Just the notification is giving me trouble.

Greetings,
Rob.


"Doron Holan [MSFT]" wrote:

> the device arrival message will include the device interface GUID and will
> include the symbolic link name to the device.
>
> WM_DEVICECHANGE
> http://msdn.microsoft.com/en-us/library/aa363205(VS.85).aspx
>
> DEV_BROADCAST_DEVICEINTERFACE Structure
> http://msdn.microsoft.com/en-us/library/aa363244(VS.85).aspx
>
> 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@discussions.microsoft.com> wrote in message
> news:28F01714-9D35-408B-A3DF-4E63C8C46AE9@microsoft.com...
> > 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@discussions.microsoft.com> wrote in message
> >> news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
> >> > 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@discussions.microsoft.com> wrote in message
> >> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
> >> >> > 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
> >> >>
> >> >>
> >>
> >>
>
>

Re: WM_DEVICECHANGE PARAMETERS by Doron

Doron
Tue Jun 17 19:10:03 CDT 2008

one of the drivers is enable the COM port device interface, the other is not
(and is just creating a symbolic COM port name link). the view in device
manager is by device class (e.g. the GUID in the INF at the top), it has no
relation to device interface.

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@discussions.microsoft.com> wrote in message
news:2344856A-8038-493D-8DB9-49070425B29D@microsoft.com...
> Hi,
> Thanks for your tips.
> I got it working for the devices I mentioned, by just registerring for
> keyboards.
> Disks and ports are an exception, and are always notified "with data".
>
> Unfortunately the custom USB-comport-device thats produced in-house by the
> company I work for, somehow is not the same as another USB-COM device I
> have.
> They both appear in devicemanager under ports (class), and are both shown
> by
> XP as a comport (deviceinterface ?) .
>
> The custom (self-built) device however, does not produce a notification
> "with data", as the other (bought) device does. The device programmer
> tells
> me that the device has the following properties (part of descriptor):
>
> 0x02, /* bcdUSB = 2.00 */
> 0x02, /* bDeviceClass: CDC */
> 0x00, /* bDeviceSubClass */
> 0x00, /* bDeviceProtocol */
> 0x40, /* bMaxPacketSize0 */
>
> Any idea what could be wrong here ?
> Strange that in XP-devicemanager, and under WinCE everything is OK.
> Just the notification is giving me trouble.
>
> Greetings,
> Rob.
>
>
> "Doron Holan [MSFT]" wrote:
>
>> the device arrival message will include the device interface GUID and
>> will
>> include the symbolic link name to the device.
>>
>> WM_DEVICECHANGE
>> http://msdn.microsoft.com/en-us/library/aa363205(VS.85).aspx
>>
>> DEV_BROADCAST_DEVICEINTERFACE Structure
>> http://msdn.microsoft.com/en-us/library/aa363244(VS.85).aspx
>>
>> 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@discussions.microsoft.com> wrote in message
>> news:28F01714-9D35-408B-A3DF-4E63C8C46AE9@microsoft.com...
>> > 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@discussions.microsoft.com> wrote in message
>> >> news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
>> >> > 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@discussions.microsoft.com> wrote in message
>> >> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
>> >> >> > 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
>> >> >>
>> >> >>
>> >>
>> >>
>>
>>


Re: WM_DEVICECHANGE PARAMETERS by Rob

Rob
Wed Jun 18 09:59:00 CDT 2008

Hi,
From reading on inet, using a USB sniffer-tool, and discussion with the
device-programmer, I suspect that maybe USBSer.sys is just not handling the
PNP behaviour correctly. I'm not sure what the driver has to do with that, I
know the details for CE, not for XP.

I would think that the OS sends the notifications when mounting the device,
not the driver, but I could be wrong....

See:
http://www.embeddedrelated.com/groups/AT91SAM/show/1763.php
http://www.lvr.com/files/usbcomport.txt

Is there a free (or cheap) alternative for usbser.sys ?

Greetings,
Rob.







"Doron Holan [MSFT]" wrote:

> one of the drivers is enable the COM port device interface, the other is not
> (and is just creating a symbolic COM port name link). the view in device
> manager is by device class (e.g. the GUID in the INF at the top), it has no
> relation to device interface.
>
> 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@discussions.microsoft.com> wrote in message
> news:2344856A-8038-493D-8DB9-49070425B29D@microsoft.com...
> > Hi,
> > Thanks for your tips.
> > I got it working for the devices I mentioned, by just registerring for
> > keyboards.
> > Disks and ports are an exception, and are always notified "with data".
> >
> > Unfortunately the custom USB-comport-device thats produced in-house by the
> > company I work for, somehow is not the same as another USB-COM device I
> > have.
> > They both appear in devicemanager under ports (class), and are both shown
> > by
> > XP as a comport (deviceinterface ?) .
> >
> > The custom (self-built) device however, does not produce a notification
> > "with data", as the other (bought) device does. The device programmer
> > tells
> > me that the device has the following properties (part of descriptor):
> >
> > 0x02, /* bcdUSB = 2.00 */
> > 0x02, /* bDeviceClass: CDC */
> > 0x00, /* bDeviceSubClass */
> > 0x00, /* bDeviceProtocol */
> > 0x40, /* bMaxPacketSize0 */
> >
> > Any idea what could be wrong here ?
> > Strange that in XP-devicemanager, and under WinCE everything is OK.
> > Just the notification is giving me trouble.
> >
> > Greetings,
> > Rob.
> >
> >
> > "Doron Holan [MSFT]" wrote:
> >
> >> the device arrival message will include the device interface GUID and
> >> will
> >> include the symbolic link name to the device.
> >>
> >> WM_DEVICECHANGE
> >> http://msdn.microsoft.com/en-us/library/aa363205(VS.85).aspx
> >>
> >> DEV_BROADCAST_DEVICEINTERFACE Structure
> >> http://msdn.microsoft.com/en-us/library/aa363244(VS.85).aspx
> >>
> >> 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@discussions.microsoft.com> wrote in message
> >> news:28F01714-9D35-408B-A3DF-4E63C8C46AE9@microsoft.com...
> >> > 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@discussions.microsoft.com> wrote in message
> >> >> news:0153784F-2B33-43C4-B915-C121014F7BE5@microsoft.com...
> >> >> > 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@discussions.microsoft.com> wrote in message
> >> >> >> news:A51D55EF-F958-40F2-920C-1AD0DB3D73A8@microsoft.com...
> >> >> >> > Hi,
> >> >> >> > I also had the problem that LParam is 0.
> >> >> >> > See codefragment below for the right (?) way to register, in
> >> >> >> > order
> >> >> >> > to
> >> >> >> > solve
> >> >> >> > that.
> >> >> >> >
> >>