XClosedCaptionSetEnabled
设置一个布尔值,指示是否启用或禁用隐藏字幕。
语法
HRESULT XClosedCaptionSetEnabled(
bool enabled
)
参数
enabled _In_
类型:bool
指示是否启用或禁用隐藏字幕的布尔值。
返回值
类型:HRESULT
如果成功,则为 HRESULT。 否则,返回错误代码。
有关错误代码的列表,请参阅错误代码。
备注
注意
在时间敏感线程上调用此函数是不安全的。 有关详细信息,请参阅时间敏感线程。
为使此函数成功,必须启用隐式字幕。 用户必须在游戏名称的 UI 中启用隐藏字幕功能。
要将隐藏字幕标记为已启用,请将 enabled 设置为 true 或 1。 要将隐藏字幕标记为已禁用,请将 enabled 设置为 false 或 0。
下面的示例演示如何以编程方式启用隐藏字幕。
//The user must first enable closed captions in the UI of the Game title. Afterwards, the game title can set the Boolean flag.
if (SUCCEEDED(XClosedCaptionsSetEnabled(true)))
{
// Closed captions successfully enabled
}
要求
头文件:XAccessibility.h
库:xgameruntime.lib
支持平台:Windows、Xbox One 系列主机和 Xbox Series 主机