views:

39

answers:

1

Does Windows provide some sort of evented API so I can run some code whenever a drive (say a usb stick) is attached?
Similar to how ReadDirectoryChangesW is for events on the filesystem?
I am not interested only in hardware changes, a user can also mount a volume, a ftp drive or similar.

+2  A: 

I am not sure of the API, but you can handle the WM_DEVICECHANGE message.

Jujjuru