C / C ++ USB Drive Event

As for the Windows platform, is this their event that I can find to tell when we plugged in a USB drive or any portable media?

+3
source share
2 answers

You will not receive such notifications without prior registration for them. Use RegisterDeviceNotification () to do this.

Once you have registered your window to receive such notifications, process the WM_DEVICECHANGE message .

+5
source

Even if this article is about Qt , the code in the answer here matters.

+2

Source: https://habr.com/ru/post/1709458/


All Articles