Alan James
Alan James

Reputation: 125

How do I detect if an external hard drive is connected

I am trying to translate some code I use to run a backup to Nim (as part of learning the language). How do I detect if one of my external hard drives is connected (by name?) and then which drive letter my Windows 10 PC has assigned to it?

Upvotes: 0

Views: 193

Answers (1)

Drake Wu
Drake Wu

Reputation: 7170

With Window message: WM_DEVICECHANGE and winapi RegisterDeviceNotification

Upvotes: 1

Related Questions