Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C/C++ USB drive event

Regarding the Windows platform, is their an event I can look for to tell when a USB drive or any type of portable media us plugged in?


1 Answers

You won't get such notifications without first registering for them. Use RegisterDeviceNotification() to do that.

After you have registered your window to receive such notifications, handle the WM_DEVICECHANGE message.

like image 110
Stefan Avatar answered Nov 19 '25 15:11

Stefan