Partager via


XHighContrastGetMode

Returns the current high contrast mode.

Syntax

HRESULT XHighContrastGetMode(  
         XHighContrastMode* mode  
)  

Parameters

mode   _Out_
Type: XHighContrastMode*

The current high contrast mode style.

Return value

Type: HRESULT

HRESULT success if mode contains the current XHighContrastMode. Otherwise, returns an error code.
For a list of error codes, see Error Codes.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

For this function to be successful, closed captions must be enabled. The user must enable the closed captions feature in the UI of the Game title. If the user enabled closed captions, your Game title can flag the status of closed captions by calling XClosedCaptionSetEnabled.

The following example demonstrates how to return the current high contrast mode.

XHighContrastMode highContrastMode;
if (SUCCEEDED(XHighContrastGetMode(&highContrastMode))
{
    // The game title can now use the enumeration result to set colors and other visual
    // options for the user interface.
}

Requirements

Header: XAccessibility.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XAccessibility

XHighContrastMode

XClosedCaptionSetEnabled