> ## 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\*](/zh-TW/reference/system/xaccessibility/enums/xhighcontrastmode)

目前的[高對比模式樣式](/zh-TW/reference/system/xaccessibility/enums/xhighcontrastmode)。

### 傳回值

類型：HRESULT

如果 *mode* 包含目前的 [XHighContrastMode](/zh-TW/reference/system/xaccessibility/enums/xhighcontrastmode)，則傳回成功的 HRESULT。否則傳回錯誤碼。\
如需錯誤碼的清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

## 備註

<Note>在時間敏感執行緒上呼叫此函式並不安全。如需詳細資訊，請參閱[時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。</Note>

若要讓此函式成功，必須啟用隱藏式字幕。
使用者必須在遊戲的 UI 中啟用隱藏式字幕功能。
如果使用者已啟用隱藏式字幕，您的遊戲可以呼叫 [XClosedCaptionSetEnabled](/zh-TW/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 主機

## 概念文件

* [時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另請參閱

[XAccessibility](/zh-TW/reference/system/xaccessibility/xaccessibility_members)

[XHighContrastMode](/zh-TW/reference/system/xaccessibility/enums/xhighcontrastmode)

[XClosedCaptionSetEnabled](/zh-TW/reference/system/xaccessibility/functions/xclosedcaptionsetenabled)


## Related topics

- [XHighContrastGetMode](/reference/system/xaccessibility/functions/xhighcontrastgetmode.md)
- [XHighContrastMode](/reference/system/xaccessibility/enums/xhighcontrastmode.md)
