1 out of 2 rated this helpful - Rate this topic

DBT_DEVNODES_CHANGED event

Applies to: desktop apps only

The system broadcasts the DBT_DEVNODES_CHANGED device event when a device has been added to or removed from the system. Applications that maintain lists of devices in the system should refresh their lists.

To broadcast this device event, the system uses the WM_DEVICECHANGE message with wParam set to DBT_DEVNODES_CHANGED and lParam set to zero.


LRESULT CALLBACK WindowProc(
  HWND hwnd,       // handle to window
  UINT uMsg,       // WM_DEVICECHANGE
  WPARAM wParam,   // device-change event
  LPARAM lParam    // event-specific data
);

Parameters

hwnd

A handle to a window.

uMsg

The WM_DEVICECHANGE message identifier.

wParam

Set to DBT_DEVNODES_CHANGED.

lParam

Set to zero.

Return value

Return TRUE.

Remarks

There is no additional information about which device has been added to or removed from the system. Applications that require more information should register for device notification using the RegisterDeviceNotification function.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Dbt.h

See also

Device Events
Device Management Events
DEV_BROADCAST_HDR
WM_DEVICECHANGE

 

 

Send comments about this topic to Microsoft

Build date: 2/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Request for additional SeeAlso
Please add a link to the functions associated with maintaining the mentioned lists of devices