When I connect/disconnect this device I should receive a WM_DEVICECHANGE
message with LParam == DBT_DEVICEARRIVAL / DBT_DEVICEREMOVECOMPLETE.
It works under Windows 2000, but it does not work under Windows XP.
I receive a WM_DEVICECHANGE messages under XP only with
LParam==DBT_DEVNODES_CHANGED.
Did anybody work with WM_DEVICECHANGE message under XP?
Thanks in advance.
for a solution that will work on windows 2000, XP RTM, XP SP1, and
later, your program could use RegisterDeviceNotification with a
NotificationFilter of type DBT_DEVTYP_DEVICEINTERFACE
(DEV_BROADCAST_DEVICEINTERFACE structure) to register for
arrival and removal notification events for members of the
GUID_DEVINTERFACE_COMPORT device interface class.
RegisterDeviceNotification:
http://msdn.microsoft.com/library/en-us/devio/base/registerdevicenotification.asp
Registering for Device Notification:
http://msdn.microsoft.com/library/en-us/devio/base/registering_for_device_notification.asp
Introduction to Device Interfaces:
http://msdn.microsoft.com/library/en-us/install/hh/install/setup-cls_8vs7.asp
when notified of a device interface DBT_DEVICEARRIVAL or
DBT_DEVICEREMOVECOMPLETE removal event (dbch_devicetype
is DBT_DEVTYP_DEVICEINTERFACE), the corresponding
DEV_BROADCAST_DEVICEINTERFACE structure will contain a path
you can use to access the device in the dbcc_name field.
DEV_BROADCAST_DEVICEINTERFACE:
http://msdn.microsoft.com/library/en-us/devio/base/dev_broadcast_deviceinterface_str.asp
hope this helps,
jim.
"al" <a...@pronan.zp.ua> wrote in message news:#Z3rWBVlCHA.2800@tkmsftngp04...