windows_programming_notes.nbk: Home | Index | Next Page: WM_DEVMODECHANGE | Previous Page: WM_DESTROYCLIPBOARD


 WM_DEVICECHANGE

The WM_DEVICECHANGE device message 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,       // WM_DEVICECHANGE
      WPARAM wParam,   // device-change event
      LPARAM lParam    // event-specific data
    );

Parameters

Return Values

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


windows_programming_notes.nbk: Home | Index | Next Page: WM_DEVMODECHANGE | Previous Page: WM_DESTROYCLIPBOARD


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time