Skip to main content
PnpObjectWatcher.Start | start method

Applies to Windows and Windows Phone

Starts raising the events to inform the client that a PnpObject has been added, updated, or removed.

Syntax


pnpObjectWatcher.start();

public void Start()

Public Sub Start()

public:
void Start()

Parameters

This method has no parameters.

Remarks

An app calls Start to begin the search for devices. During this intial enumeration, the PnpObjectWatcher raises an Added event for each device that's found, until all devices are found. The PnpObjectWatcher raises an EnumerationCompleted event when the initial enumeration is complete, and continues to raise events if a device is added, updated, or removed.

The Start method can only be called when the PnpObjectWatcher is in the Created, Stopped or Aborted state. The Status property indicates the PnpObjectWatcher state. When re-starting the watcher, wait for the Stopped event before calling Start.

The following diagram shows how the PnpObjectWatcher transitions between the states represented by DeviceWatcherStatus enumeration.

state diagram of DeviceWatcher states

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Enumeration.Pnp
Windows::Devices::Enumeration::Pnp [C++]

Metadata

Windows.winmd

See also

PnpObjectWatcher