DisplayManager DisplayManager DisplayManager DisplayManager DisplayManager Class

Definition

Manages the ownership of a DisplayTarget object or objects, and provides methods to create DisplayState objects.

public : sealed class DisplayManager : IClosable
struct winrt::Windows::Devices::Display::Core::DisplayManager : IClosable
public sealed class DisplayManager : IDisposable
Public NotInheritable Class DisplayManager Implements IDisposable
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10, version 1809 (introduced v10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v7)

Remarks

This object implements IClosable/IDisposable, which should be used to revoke ownership of all DisplayTarget objects once they are no longer being used.

Methods

Close() Close() Close() Close() Close()

Revokes ownership of all DisplayTarget objects owned by this DisplayManager instance.

Create(DisplayManagerOptions) Create(DisplayManagerOptions) Create(DisplayManagerOptions) Create(DisplayManagerOptions) Create(DisplayManagerOptions)

Creates a DisplayManager instance with the specified options.

CreateDisplayDevice(DisplayAdapter) CreateDisplayDevice(DisplayAdapter) CreateDisplayDevice(DisplayAdapter) CreateDisplayDevice(DisplayAdapter) CreateDisplayDevice(DisplayAdapter)

Creates a DisplayDevice object for the given adapter. The DisplayDevice can be used to create and present full-screen content to targets on the given adapter.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetCurrentAdapters() GetCurrentAdapters() GetCurrentAdapters() GetCurrentAdapters() GetCurrentAdapters()

Enumerates the set of display adapters currently present on the system.

GetCurrentTargets() GetCurrentTargets() GetCurrentTargets() GetCurrentTargets() GetCurrentTargets()

Enumerates the set of display targets currently present on the system.

ReleaseTarget(DisplayTarget) ReleaseTarget(DisplayTarget) ReleaseTarget(DisplayTarget) ReleaseTarget(DisplayTarget) ReleaseTarget(DisplayTarget)

Releases ownership of the specified display target, allowing other components on the system to acquire ownership.

Start() Start() Start() Start() Start()

Starts listening for all DisplayManager events atomically. DisplayManager events are not raised until you call Start.

Stop() Stop() Stop() Stop() Stop()

Stops listening to all DisplayManager events atomically, and triggers Disabled synchronously.

TryAcquireTarget(DisplayTarget) TryAcquireTarget(DisplayTarget) TryAcquireTarget(DisplayTarget) TryAcquireTarget(DisplayTarget) TryAcquireTarget(DisplayTarget)

Attempts to acquire exclusive ownership of a DisplayTarget.

TryAcquireTargetsAndCreateEmptyState(IIterable<DisplayTarget>) TryAcquireTargetsAndCreateEmptyState(IIterable<DisplayTarget>) TryAcquireTargetsAndCreateEmptyState(IIterable<DisplayTarget>) TryAcquireTargetsAndCreateEmptyState(IIterable<DisplayTarget>) TryAcquireTargetsAndCreateEmptyState(IIterable<DisplayTarget>)

Attempts to acquire exclusive ownership of a collection of DisplayTarget objects, and creates an empty modifiable DisplayState object, which supports connecting paths to these targets.

TryAcquireTargetsAndCreateSubstate(DisplayState, IIterable<DisplayTarget>) TryAcquireTargetsAndCreateSubstate(DisplayState, IIterable<DisplayTarget>) TryAcquireTargetsAndCreateSubstate(DisplayState, IIterable<DisplayTarget>) TryAcquireTargetsAndCreateSubstate(DisplayState, IIterable<DisplayTarget>) TryAcquireTargetsAndCreateSubstate(DisplayState, IIterable<DisplayTarget>)

Attempts to acquire exclusive ownership of a collection of DisplayTarget objects, and carves out a subset of a given DisplayState for only the targets passed to this method. The resulting state can be modified and applied.

TryAcquireTargetsAndReadCurrentState(IIterable<DisplayTarget>) TryAcquireTargetsAndReadCurrentState(IIterable<DisplayTarget>) TryAcquireTargetsAndReadCurrentState(IIterable<DisplayTarget>) TryAcquireTargetsAndReadCurrentState(IIterable<DisplayTarget>) TryAcquireTargetsAndReadCurrentState(IIterable<DisplayTarget>)

Attempts to acquire exclusive ownership of a collection of DisplayTarget objects, and creates a modifiable DisplayState populated with the current state of the supplied targets.

TryReadCurrentStateForAllTargets() TryReadCurrentStateForAllTargets() TryReadCurrentStateForAllTargets() TryReadCurrentStateForAllTargets() TryReadCurrentStateForAllTargets()

Creates a read-only DisplayState object populated with the entire system display state for all targets.

Events

Changed Changed Changed Changed Changed

An event that is raised when system display hardware is added, removed, or modified. This can occur whenever the enumerations of DisplayAdapter objects and DisplayTarget objects are different, so we recommended that you subscribe to this event and call GetCurrentAdapters and/or GetCurrentTargets to determine what has changed.

Disabled Disabled Disabled Disabled Disabled

An event raised whenever the current session's display stack is disabled, and when DisplayManager.Stop is called. You can disable the session display stack in several cases, such as switching Terminal Services sessions, or to recover from driver failures. We recommend that subscribers attempt to clean up when Disabled is invoked. Most display APIs will fail while the session display stack is disabled.

Enabled Enabled Enabled Enabled Enabled

An event raised whenever the current session's display stack is enabled, and when DisplayManager.Start is called. You can re-enable the session display stack in several cases, such as switching Terminal Services sessions, or to recover from driver failures. We recommend that subscribers re-enumerate all targets and state in this call, since the system display stack could be left in any state before this event is raised.

PathsFailedOrInvalidated PathsFailedOrInvalidated PathsFailedOrInvalidated PathsFailedOrInvalidated PathsFailedOrInvalidated

An event that is raised whenever a display path is failed or invalidated asynchronously by the system. This can be due to changing hardware bandwidth requirements, or due to driver failures.

Subscribers to this event should call TryAcquireTargetsAndReadCurrentState for targets that they own, and check whether any of the paths in the resulting DisplayState object have their Status property set to FailedAsync or InvalidatedAsync, and take the recommended action.