Reading Device Manager's Property Fields in Windows 7/8

前端 未结 3 1267
野性不改
野性不改 2021-02-09 17:42

I am developing a windows application which gives the field details --> X.

Where X is -->

Right Click My Computer >

    Properties >

                


        
3条回答
  •  太阳男子
    2021-02-09 18:42

    The question is tagged with C#, though the actual question asks for any Window API. With the Win32 API the information can be retrieved with SetupDiGetDeviceRegistryProperty(). The steps would be:

    1. Get a device info set for the devices you're interested in via SetupDiGetClassDevs().
    2. Iterate through the device infos via SetupDiEnumDeviceInfo().
    3. Get the properties via calls to SetupDiGetDeviceRegistryProperty().
    4. Destroy the device info set via SetupDiDestroyDeviceInfoList().

    According to the documentation the API is available on Windows 2000 and later.

提交回复
热议问题