这个是函数声明,动态链接库我也已经拷到程序目录下:<br>function SetupDiGetClassDevs(ClassGuid: PGUID; Enumerator: PAnsiChar; hwndParent: LongWord; Flags: LongWord):Thandle; stdcall; external 'setupapi.dll'; <br>函数调用为:<br>var<br> HardwareDeviceInfo: Thandle;<br> MyPGuid: PGUID;<br>begin<br> HardwareDeviceInfo := SetupDiGetClassDevs(MyPGuid,Nil,0,2);<br> if HardwareDeviceInfo = Invalid_Handle_Value then showmessage('获取设备信息集');<br>end;