The WM_DEVICECHANGE device message notifies an application or device driver of a change to the hardware configuration of a device or the computer.<br><br>Event = (UINT) wParam;<br>dwData = (DWORD) lParam;<br> <br><br>Parameters<br><br>Event<br><br>Event type. This parameter can be one of the following values:<br><br>Value Meaning<br>DBT_CONFIGCHANGECANCELED A request to change the current configuration (dock or undock) has been canceled.<br>DBT_CONFIGCHANGED The current configuration has changed, due to a dock or undock. <br>DBT_DEVICEARRIVAL A device has been inserted and is now available. <br>DBT_DEVICEQUERYREMOVE Permission is requested to remove a device. Any application can deny this request and cancel the removal.<br>DBT_DEVICEQUERYREMOVEFAILED A request to remove a device has been canceled.<br>DBT_DEVICEREMOVECOMPLETE A device has been removed.<br>DBT_DEVICEREMOVEPENDING A device is about to be removed. Cannot be denied.<br>DBT_DEVICETYPESPECIFIC A device-specific event has occurred.<br>DBT_QUERYCHANGECONFIG Permission is requested to change the current configuration (dock or undock). <br>DBT_USERDEFINED The meaning of this message is user-defined.<br> <br><br>dwData<br><br>Address of a structure that contains event-specific data. Its meaning depends on the given event.<br><br> <br><br>Return Values<br><br>Return TRUE to grant a requested action.<br>Return QUERY_BROADCAST_DENY to deny a requested action.<br><br>Remarks<br><br>For devices that offer software-controllable features, such as ejection and locking, the operating system typically sends a DBT_DEVICEREMOVEPENDING message to let applications and device drivers end their use of the device gracefully. <br>If the operating system forcibly removes a device, it may not send a DBT_DEVICEQUERYREMOVE message before doing so.<br>DBT_CONFIGCHANGECANCELED, DBT_CONFIGCHANGED, DBT_DEVICEARRIVAL, DBT_DEVICEQUERYREMOVE, DBT_DEVICEQUERYREMOVEFAILED, DBT_DEVICEREMOVECOMPLETE, DBT_DEVICEREMOVEPENDING, DBT_DEVICETYPESPECIFIC, DBT_QUERYCHANGECONFIG, DBT_USERDEFINED