Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DeviceWatcher.Stop | stop method

Stop raising the events that add, update and remove enumeration results.

Syntax

Public Sub Stop()

Parameters

This method has no parameters.

Remarks

To stop a search for devices, an app calls Stop and enters the Stopping state. The Stopped event is raised when the Stop operation completes and the DeviceWatcher enters the Stopped state.

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

state diagram of DeviceWatcher states

This call transitions the DeviceWatcher to the Stopping state and completes immediately. The watcher will transition to the Stopped state once all events that are already in the process of being raised have completed.

Callers may wait for the Stopped event if they need to know when the DeviceWatcher has stopped. Callers must wait for the Stopped event before they can call Start to restart the watcher. Callers may unsubscribe from events if they do not want to receive any additional events after Stop but do not want to wait for the Stopped event.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Namespace

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

Metadata

Windows.winmd

See also

DeviceWatcher

 

 

Show:
© 2014 Microsoft. All rights reserved.