> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XHighContrastGetMode

> XHighContrastGetMode

# XHighContrastGetMode

返回当前的高对比度模式。

## 语法

```cpp theme={null}
HRESULT XHighContrastGetMode(  
         XHighContrastMode* mode  
)  
```

### 参数

*mode*   \_Out\_\
类型：[XHighContrastMode\*](/reference/system/xaccessibility/enums/xhighcontrastmode)

当前的[高对比度模式样式](/reference/system/xaccessibility/enums/xhighcontrastmode)。

### 返回值

类型：HRESULT

如果 *mode* 包含当前的 [XHighContrastMode](/reference/system/xaccessibility/enums/xhighcontrastmode)，则返回 HRESULT 成功。否则返回错误代码。\
有关错误代码的列表，请参阅 [错误代码](/reference/errorcodes)。

## 备注

<Note>此函数不能在时间敏感线程上安全调用。有关详细信息，请参阅 [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。</Note>

要使此函数调用成功，必须启用隐藏式字幕。
用户必须在游戏 title 的 UI 中启用隐藏式字幕功能。
如果用户启用了隐藏式字幕，则你的游戏 title 可以通过调用 [XClosedCaptionSetEnabled](/reference/system/xaccessibility/functions/xclosedcaptionsetenabled) 来标记隐藏式字幕的状态。

以下示例演示了如何返回当前的高对比度模式。

```cpp theme={null}
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.
}
```

## 要求

**头文件：** XAccessibility.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念性文档

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)

[XHighContrastMode](/reference/system/xaccessibility/enums/xhighcontrastmode)

[XClosedCaptionSetEnabled](/reference/system/xaccessibility/functions/xclosedcaptionsetenabled)


## Related topics

- [XHighContrastMode](/zh-CN/reference/system/xaccessibility/enums/xhighcontrastmode.md)
- [XAG 102：对比度](/zh-CN/build/game-principles/accessibility/xag-deep-dives/xag-102-contrast.md)
- [XAccessibility](/zh-CN/reference/system/xaccessibility/xaccessibility_members.md)
- [GDK 无障碍概览](/zh-CN/build/game-principles/accessibility/accessibility-overview.md)
- [XAG 101：文本显示](/zh-CN/build/game-principles/accessibility/xag-deep-dives/xag-101-text-display.md)
