Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1630513
  • 博文数量: 584
  • 博客积分: 13857
  • 博客等级: 上将
  • 技术积分: 11883
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-16 09:34

分类: C/C++

2011-04-11 10:28:43

SetupDiGetClassDevs

HDEVINFO

SetupDiGetClassDevs(

IN PGUID ClassGuid, /* optional */

IN PCTSTR Enumerator, /* optional */

IN HWND hwndParent, /* optional */

IN DWORD Flags

);

SetupDiGetClassDevs returns a device information set that contains all installed devices of a specified class.

获取一个指定类别或全部类别的所有已安装设备的信息

Parameters

ClassGuid

Supplies a pointer to the class GUID to use when creating the list of devices. If the DIGCF_ALLCLASSES flag is set, this parameter is ignored and the resulting list contains all installed classes.

一个特定类别GUID(需要查询注册表)的指针,如果设置了DIGCF_ALLCLASSES标记,该参数备忽略,将返回所有类别的设备信息表

Enumerator

Supplies the name of the key under the Enum registry branch that contains device instances for which information is to be retrieved. If this parameter is not specified, device information is retrieved for all device instances in the entire Enum tree.

过滤梅举的内容:如:PCI则只显示PCI设备,

hwndParent

Supplies the handle of the top-level window to be used for any user interface relating to the members of this set.

用于关联到集合成员中的用户接口的顶层窗口句柄

Flags

Supplies control options used in building the device information set. Can be one of the following values:

建立设备信息表的控制选项,可以是下列值

DIGCF_PRESENT

Return only devices that are currently present. (只列出当前存在的设备信息)

DIGCF_ALLCLASSES

Return a list of installed devices for all classes. If this flag is set, the ClassGuid parameter is ignored. (列出所有类别的一安装的设备表,如果设置了此值,则指定的类别将备忽略)

DIGCF_PROFILE

Return only devices that are a part of the current hardware profile. (只返回当前硬件概况部分)

Return Value

If the function succeeds, it returns a handle to a device information set containing all installed devices matching the specified parameters.

如成功,返回包含所有与指定参数匹配的已经安装设备信息句柄

If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

如失败则返回INVALID_HANDLE_VALUE

阅读(1933) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~