Getting list of devices plugged in in a pc (windows platform)

45 Views Asked by At

I am working on a project and I need to get the list of plugged in devices in the PC, just like the Windows Device Manager does.

enter image description here

But I don't know how to communicate with Windows to retrive the list of available devices in Delphi Firemonkey framework. I am using Delphi 12.

1

There are 1 best solutions below

0
Tim Roberts On BEST ANSWER

Everything that Device Manager does is done through the "SetupDi" APIs. They are powerful, but very wordy. The devcon tool from Microsoft also does all of these functions, and the source code is available:

https://github.com/microsoft/Windows-driver-samples/tree/main/setup/devcon

Please note that this is complicated. Be patient, follow the sample.