<br> Platform SDK: Hardware <br>WM_DEVICECHANGE<br>The WM_DEVICECHANGE device message notifies an application of a <br>change to the hardware configuration of a device or the computer.<br><br>A window receives this message through its WindowProc function. <br><br>LRESULT CALLBACK WindowProc(<br> HWND hwnd, // handle to window<br> UINT uMsg, // WM_DEVICECHANGE<br> WPARAM wParam, // device-change event<br> LPARAM lParam // event-specific data<br>);<br>Parameters<br>wParam <br>Specifies the event. This parameter can be one of the following values. <br>Value Meaning <br>DBT_CONFIGCHANGECANCELED A request to change the current configuration <br>(dock or undock) has been canceled. <br>DBT_CONFIGCHANGED The current configuration has changed, due to a dock <br>or undock. <br>DBT_CUSTOMEVENT Windows 98 and Windows 2000: A custom event has occurred. <br>DBT_DEVICEARRIVAL A device has been inserted and is now available. <br>DBT_DEVICEQUERYREMOVE Permission is requested to remove a device. <br>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 <br>configuration (dock or undock). <br>DBT_USERDEFINED The meaning of this message is user-defined. <br><br><br>lParam <br>Pointer to a structure that contains event-specific data. Its format <br>depends on the value of the wParam parameter. For more information, refer <br>to the documentation for each event. <br>Return Values<br>Return TRUE to grant the request.<br><br>Return BROADCAST_QUERY_DENY to deny the request.<br><br>Remarks<br>For devices that offer software-controllable features, such as ejection and <br>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.<br><br>Requirements <br> Windows NT/2000: Requires Windows NT 4.0 or later.<br> Windows 95/98: Requires Windows 95 or later.<br> Header: Declared in Winuser.h; include Windows.h.<br><br>See Also<br>Device Management Overview, Device Management Messages, <br>DBT_CONFIGCHANGECANCELED, DBT_CONFIGCHANGED, DBT_CUSTOMEVENT, <br>DBT_DEVICEARRIVAL, DBT_DEVICEQUERYREMOVE, DBT_DEVICEQUERYREMOVEFAILED, <br>DBT_DEVICEREMOVECOMPLETE, DBT_DEVICEREMOVEPENDING, DBT_DEVICETYPESPECIFIC, <br>DBT_QUERYCHANGECONFIG, DBT_USERDEFINED<br><br>Built on Thursday, October 12, 2000Requirements <br> Windows NT/2000: Requires Windows NT 4.0 or later.<br> Windows 95/98: Requires Windows 95 or later.<br> Header: Declared in Winuser.h; include Windows.h.<br>See Also<br>Device Management Overview, Device Management Messages, <br>DBT_CONFIGCHANGECANCELED, DBT_CONFIGCHANGED, DBT_CUSTOMEVENT, <br>DBT_DEVICEARRIVAL, DBT_DEVICEQUERYREMOVE, DBT_DEVICEQUERYREMOVEFAILED, <br>DBT_DEVICEREMOVECOMPLETE, DBT_DEVICEREMOVEPENDING, DBT_DEVICETYPESPECIFIC, <br>DBT_QUERYCHANGECONFIG, DBT_USERDEFINED<br>