【问题标题】:Determine what devices are plugged in and their type确定插入的设备及其类型
【发布时间】:2012-12-30 04:28:08
【问题描述】:

我正在尝试列出当前使用 Win32 API 插入计算机/笔记本电脑的所有设备。当我说设备时,我的意思是;耳机、USB 存储设备、HDMI 连接(电视或投影仪)、打印机等。

最好的 Native Win32 函数用于简单地检测插入了哪些设备以及它们是什么类型?

功能:

SetupDiClassGuidsFromNameA("Ports", 0, 0, &RequiredSize);
SetupDiClassGuidsFromNameA("Ports", (_GUID*)buf, RequiredSize*sizeof(GUID), &RequiredSize);

SetupDiEnumDeviceInfo(DeviceInfoSet,numDev,&DeviceInfoData); 

最好?

【问题讨论】:

    标签: c++ winapi port


    【解决方案1】:

    是的,Setup API 是在 C++ 中枚举设备的方法。

    这是一个简单的示例:http://www.codeproject.com/Articles/6445/Enumerate-Installed-Devices-Using-Setup-API

    【讨论】:

      猜你喜欢
      • 2012-12-19
      • 2012-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多