kemyliu 发表于 2010-5-31 15:27:03

如何获得一个device的Location information?

本帖最后由 kemyliu 于 2010-5-31 20:26 编辑

求助!如何获得一个device的Location information?自己研究过pusofalse 的<SetUPAPI.au3>库,可是还是不知如何获得,达人请看下图,同时请高人指教!!

pusofalse 发表于 2010-5-31 15:39:10

#include <SetupAPI.au3>

Local $sDeviceId, $hDevInst, $sLocation

; Device Identifier string.
$sDeviceId = _CM_Get_Device_Id_By_Name_Ex("USB Composite Device", 1)

; Handle to device instance.
$hDevInst = _CM_Locate_DevNode($sDeviceId)

$sLocation = _CM_Get_DevNode_Registry_Property($hDevInst, $CM_DRP_LOCATION_INFORMATION)
Msgbox(0, "", $sLocation)

kemyliu 发表于 2010-5-31 16:46:02

对于pusofalse 大大的感谢真是如滔滔江水!
页: [1]
查看完整版本: 如何获得一个device的Location information?