> ## 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.

# XClosedCaptionGetProperties

> XClosedCaptionGetProperties

# XClosedCaptionGetProperties

返回当前隐藏式字幕的属性。

## 语法

```cpp theme={null}
HRESULT XClosedCaptionGetProperties(  
         XClosedCaptionProperties* properties  
)  
```

### 参数

*properties*   \_Out\_\
类型：[XClosedCaptionProperties\*](/reference/system/xaccessibility/structs/xclosedcaptionproperties)

函数返回时，*properties* 包含当前的隐藏式字幕属性。

### 返回值

类型：HRESULT

如果启用了隐藏式字幕且 *properties* 包含当前的 [XClosedCaptionProperties](/reference/system/xaccessibility/structs/xclosedcaptionproperties)，则返回 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}
XClosedCaptionProperties ccProperties;
if (SUCCEEDED(XClosedCaptionGetProperties(&ccProperties))
{
    // The game title can now access color and font settings in the ccProperties structure.
}
```

## 要求

**头文件：** 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)

[XClosedCaptionProperties](/reference/system/xaccessibility/structs/xclosedcaptionproperties)

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


## Related topics

- [XClosedCaptionProperties](/zh-CN/reference/system/xaccessibility/structs/xclosedcaptionproperties.md)
- [XClosedCaptionFontStyle](/zh-CN/reference/system/xaccessibility/enums/xclosedcaptionfontstyle.md)
- [XClosedCaptionFontEdgeAttribute](/zh-CN/reference/system/xaccessibility/enums/xclosedcaptionfontedgeattribute.md)
- [XClosedCaptionSetEnabled](/zh-CN/reference/system/xaccessibility/functions/xclosedcaptionsetenabled.md)
- [XAG 104：字幕与隐藏字幕](/zh-CN/build/game-principles/accessibility/xag-deep-dives/xag-104-subtitles-captions.md)
