Notifies an application of a change to the hardware configuration of a device or the computer.
A window receives this message through its
WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
Parameters
- hwnd
A handle to the window.
- uMsg
The WM_DEVICECHANGE identifier.
- wParam
The event that has occurred. This parameter can be one of the following values from the Dbt.h header file.
- lParam
A pointer to a structure that contains event-specific data. Its format depends on the value of the wParam parameter. For more information, refer to the documentation for each event.
Return Value
Return TRUE to grant the request.
Return BROADCAST_QUERY_DENY to deny the request.
Remarks
For devices that offer software-controllable features, such as ejection and locking, the system typically sends a
DBT_DEVICEREMOVEPENDING message to let applications and device drivers end their use of the device gracefully. If the system forcibly removes a device, it may not send a
DBT_DEVICEQUERYREMOVE
message before doing so.
Requirements
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | Winuser.h (include Windows.h or Dbt.h) |
See Also
- DBT_CONFIGCHANGECANCELED
- DBT_CONFIGCHANGED
- DBT_CUSTOMEVENT
- DBT_DEVICEARRIVAL
- DBT_DEVICEQUERYREMOVE
- DBT_DEVICEQUERYREMOVEFAILED
- DBT_DEVICEREMOVECOMPLETE
- DBT_DEVICEREMOVEPENDING
- DBT_DEVICETYPESPECIFIC
- DBT_DEVNODES_CHANGED
- DBT_QUERYCHANGECONFIG
- DBT_USERDEFINED
Send comments about this topic to Microsoft
Build date: 12/11/2009