The Device Object represents the current device instance and is the entry point into WPD Automation. The Device Object provides access and enumeration of device services and storages as well as access to device specific properties, events, and services.
A Device Object is created through the following property of a scripting host.
var deviceObject = window.external;
Note A Device Object is functional only while the physical device that it represents is connected. Any operations performed on a Device Object after the physical device is disconnected will return an error and raise a DISP_E_EXCEPTION exception, with pExcepInfo filled out.
The Device object has these types of members:
The Device object has these events.
Occurs when the device is about to reset.
Occurs when the device has been updated, as when a device property has been changed.
The Device object has these methods.
Returns a collection of services for the specified service type.
The Device object has these properties.
Provides read-only access to a collection of all the services on the device.
Provides read-only access to a collection of all the legacy storages on the device.
Gets or sets the value of a device-specific property.
Minimum supported client
|Windows 7 [desktop apps only]|
Minimum supported server
|Windows Server 2008 R2 [desktop apps only]|