DeviceInfo.GetPropById method
The GetPropById method of the DeviceInfo object uses a device property's ID to return its value.
Syntax
retVal = DeviceInfo.GetPropById(
Id
)
Parameters
-
Id [in]
-
Type: WiaDeviceInfoPropertyId
Specifies the ID of the property.
Return value
Type: VARIANT
This method returns the value of the property specified by Id.
Remarks
Use this method to find the value of a device property from its ID. For a list of property IDs, see WIA Property Constant Definitions. For information about Windows Image Acquisition (WIA) properties themselves, see WIA Property Constants.
For Microsoft Visual Basic applications, add a reference to "Windows Image Acquisition 1.01 Type Library". This following constants defined in that file are valid for this method:
const DeviceID = 2
const Manufacturer = 3
const Description = 4
const Type = 5
const Port = 6
const Name = 7
const Server = 8
const RemoteDevID = 9
const UIClassID = 10
Examples
The following example demonstrates the use of the GetPropById method to retrieve a property value.
<SCRIPT LANGUAGE="VBScript">
const WIA_DIP_DEV_TYPE = 5
Dim objWia
Dim objDeviceInfoCollection
Dim objDeviceInfo
Dim PropValue
Set objWIA = CreateObject("Wia.Script")
Set objDeviceInfoCollection = objWia.Devices
For Each objDeviceInfo In objDeviceInfoCollection
PropValue = objDeviceInfo.GetPropById(WIA_DIP_DEV_TYPE)
Next
</SCRIPT>
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server |
Windows Server 2003 [desktop apps only] |
DLL |
|