DisplayMonitor Class

Definition

Provides information about a display monitor device connected to the system.

These data include commonly used information from the monitor's Extended Display Identification Data (EDID, which is an industry-standard display descriptor block that nearly all monitors use to provide descriptions of supported modes and general device information) and DisplayID (which is a newer industry standard that provides a superset of EDID).

public ref class DisplayMonitor sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772165)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.Devices.Display.IDisplayMonitorStatics, 393216, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DisplayMonitor final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772165)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.Devices.Display.IDisplayMonitorStatics), 393216, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DisplayMonitor
Public NotInheritable Class DisplayMonitor
Inheritance
DisplayMonitor
Attributes

Windows 10 requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Remarks

Version history

Windows version SDK version Value added
2004 19041 IsDolbyVisionSupportedInHdrMode

Properties

BluePrimary

Gets the chromaticity blue primary point (calculated from the monitor's Extended Display Identification Data, or EDID, and any driver overrides).

ConnectionKind

Gets a value representing the abstract method in which the display is connected (not specific to a physical protocol).

DeviceId

Gets the device identifier.

DisplayAdapterDeviceId

Gets the device identifier of the display adapter to which the monitor is connected. Note that the display adapter may not be the most suitable device for rendering.

DisplayAdapterId

Gets the locally unique identifier (LUID) of the display adapter to which the monitor is connected. Note that the display adapter to which the monitor is connected may not be the most suitable one for rendering.

An LUID is a 64-bit value guaranteed to be unique only on the system on which it was generated. The uniqueness of an LUID is guaranteed only until the system is restarted. This LUID is compatible with Direct3D, DisplayConfig, and HolographicSpace APIs.

DisplayAdapterTargetId

Gets an opaque ID used by the display adapter to identify which connector the monitor is attached to. This target ID can be used with DisplayConfig APIs.

DisplayName

Gets a friendly name for the device suitable for display to a user.

GreenPrimary

Gets the chromaticity green primary point (calculated from the monitor's Extended Display Identification Data, or EDID, and any driver overrides).

IsDolbyVisionSupportedInHdrMode

Gets a value that indicates whether the monitor's metadata has specified that it treats high dynamic range (HDR) as a special Dolby Vision mode. This API is intended to be used by the DolbyVision video decoder running within media to play specially certified content.

MaxAverageFullFrameLuminanceInNits

Gets the monitor's maximum average full-frame luminance in nits.

MaxLuminanceInNits

Gets the monitor's maximum luminance in nits.

MinLuminanceInNits

Gets the monitor's minimum luminance in nits.

NativeResolutionInRawPixels

Gets the monitor's native resolution in raw pixels.

PhysicalConnector

Gets a value representing the physical connector standard used to connect the display.

PhysicalSizeInInches

Gets the monitor's physical diagonal size in inches.

RawDpiX

Gets the physical horizontal DPI of the monitor (based on the monitor’s native resolution and physical size).

RawDpiY

Gets the physical vertical DPI of the monitor (based on the monitor’s native resolution and physical size).

RedPrimary

Gets the chromaticity red primary point (calculated from the monitor's Extended Display Identification Data, or EDID, and any driver overrides).

UsageKind

Gets a value representing the use to which the display is being put.

WhitePoint

Gets the chromaticity white point (calculated from the monitor's Extended Display Identification Data, or EDID, and any driver overrides).

Methods

FromIdAsync(String)

Asynchronously creates a DisplayMonitor object for the specified device identifier (a string containing a PnP device instance path). See the code example below.

Note

The argument must be a device identifier, and not a device interface identifier. If you have a device interface identifier (which is likely), then call FromInterfaceIdAsync instead. For more details, see DeviceInformation.Id.

FromInterfaceIdAsync(String)

Asynchronously creates a DisplayMonitor object for the specified monitor interface identifier (a string containing a PnP device interface path). See the code example below.

Note

If you call DeviceInformation.FindAllAsync, passing the Advanced Query Syntax (AQS) device interface selector string returned by DisplayMonitor.GetDeviceSelector, then you will retrieve a collection of DeviceInformation objects that describe monitor interfaces (rather than monitor devices). Accessing the DeviceInformation.Id property on one of those objects retrieves a monitor interface identifier, which you can pass to DisplayMonitor.FromInterfaceIdAsync. See the code example below.

Most Win32 APIs that provide a monitor identifier actually provide the monitor interface identifier (and not the device identifier).

GetDescriptor(DisplayMonitorDescriptorKind)

Retrieves a hardware descriptor of the kind specified.

GetDeviceSelector()

Returns an Advanced Query Syntax (AQS) device interface selector string for the purpose of retrieving device interfaces (rather than devices).

The selector can be used by DeviceInformation.CreateWatcher to watch and enumerate monitor devices on the system. Or it can be used with DeviceInformation.FindAllAsync to retrieve a collection of DeviceInformation objects that describe monitor interfaces (rather than monitor devices). Accessing the DeviceInformation.Id property on one of those objects retrieves a monitor interface identifier, which you can pass to DisplayMonitor.FromInterfaceIdAsync (for details, see the code example for DisplayMonitor.FromInterfaceIdAsync ). If you request the System.Devices.DeviceInstanceId additional property from FindAllAsync, then you can call DisplayMonitor.FromIdAsync (for details, see the code example for DisplayMonitor.FromIdAsync ).

Applies to