最終更新:2017-10-17 (火) 15:01:42 (758d)  

WM_DEVICECHANGE はてなブックマークを見る
Top / WM_DEVICECHANGE

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.

https://msdn.microsoft.com/ja-jp/library/windows/desktop/aa363480(v=vs.85).aspx

パラメータ

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

uMsg?

wParam

  • DBT_DEVNODES_CHANGED0x0007A device has been added to or removed from the system.
    DBT_DEVICEARRIVAL0x8000 (32768)A device or piece of media has been inserted and is now available.
    DBT_DEVICEQUERYREMOVE?0x8001Permission is requested to remove a device or piece of media. Any application can deny this request and cancel the removal.
    DBT_DEVICEQUERYREMOVEFAILED?0x8002A request to remove a device or piece of media has been canceled.
    DBT_DEVICEREMOVEPENDING?0x8003A device or piece of media is about to be removed. Cannot be denied.
    DBT_DEVICEREMOVECOMPLETE?0x8004A device or piece of media has been removed.
    DBT_DEVICETYPESPECIFIC?0x8005A device-specific event has occurred.

Hardware Helper Library for C#

Detecting Hardware Insertion and/or Removal

メモ

関連

参考