DisplayTarget.TryGetMonitor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to retrieve an object describing the monitor currently connected to this DisplayTarget. This method can fail or return a different monitor than the properties on the DisplayTarget describe if monitors have been plugged or unplugged from the DisplayTarget since the DisplayTarget object was created. IsStale returns true if the monitor might have changed since the DisplayTarget was created.
public:
virtual DisplayMonitor ^ TryGetMonitor() = TryGetMonitor;
DisplayMonitor TryGetMonitor();
public DisplayMonitor TryGetMonitor();
function tryGetMonitor()
Public Function TryGetMonitor () As DisplayMonitor
Returns
A DisplayMonitor representing the monitor connected to this target, if one is connected, or else null if nothing is connected.
Remarks
Since this method has Try in its name, it returns null instead of throwing an exception or returning a failure HRESULT.