DisplayTaskResult.SourceStatus Property
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.
Gets the current status of the DisplaySource immediately before DisplayTaskPool.TryExecuteTask returns.
public:
property DisplaySourceStatus SourceStatus { DisplaySourceStatus get(); };
DisplaySourceStatus SourceStatus();
public DisplaySourceStatus SourceStatus { get; }
var displaySourceStatus = displayTaskResult.sourceStatus;
Public ReadOnly Property SourceStatus As DisplaySourceStatus
Property Value
A DisplaySourceStatus representing the current status of the DisplaySource immediately before DisplayTaskPool.TryExecuteTask returns.
Remarks
You can also obtain a DisplaySourceStatus (representing the status of a display source) by accessing the standalone DisplaySource.Status property.
Status is returned for DisplayTaskPool.TryExecuteTask in order to provide a complete picture of the system state that potentially affected the last-requested present.
When DisplayTaskResult.PresentStatus returns a value pointing to a DisplaySource, the SourceStatus property is useful for determining different error conditions hit by TryExecuteTask due to DisplaySource. Your DirectDisplay client should also register for the DisplaySource.StatusChanged event. That's because the status of a DisplaySource can also change asynchronously to TryExecuteTask, and it will give you an indication about when to retry TryExecuteTask.
One common usage of SourceStatus is when TryExecuteTask returns SourceStatusPreventedPresent in PresentStatus. In that case if the SourceStatus is PoweredOff, then that specifies a scenario where the most recent present was not queued in the graphics scheduler since the physical display path is considered powered off from the kernel's perspective. You should then look out for the DisplaySourceStatus change event, and check when the display is powered on again, and then resume calling TryExecuteTask.