Detecting USB Insertion / Removal Events in Windows using C++

Create a dummy window that does nothing but wait for WM_DEVICECHANGE and register that window using RegisterDeviceNotification. WMI is an overkill here, IMHO.

Leave a Comment