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

# XGameUiSetNotificationPositionHint

> XGameUiSetNotificationPositionHint

# XGameUiSetNotificationPositionHint

设置在当前游戏中显示 toast 通知的首选位置。

## 语法

```cpp theme={null}
HRESULT XGameUiSetNotificationPositionHint(  
         XGameUiNotificationPositionHint position  
)  
```

### 参数

*position*   \_In\_\
类型：[XGameUiNotificationPositionHint](https://docs.xbox.com/zh-CN/reference/system/xgameui/enums/xgameuinotificationpositionhint.md)

指示在当前游戏上显示 toast 通知的首选位置。

### 返回值

类型：HRESULT

## 备注

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

通知位置是对操作系统显示 toast 通知位置的提示。在某些情况下，如果当前 UI 无法支持在该位置显示通知，系统可能会选择忽略此设置。默认情况下，在 XBOX 上，toast 通知显示在屏幕底部居中位置。

此 API 存在于 Windows 中，但目前对成就和其他 toast 通知没有影响。

## 要求

**标头：** XGameUI.h

**库：** xgameruntime.lib

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

## 概念文档

* [时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

[XGameUI](https://docs.xbox.com/zh-CN/reference/system/xgameui/xgameui_members.md)\
[XGameUiNotificationPositionHint](https://docs.xbox.com/zh-CN/reference/system/xgameui/enums/xgameuinotificationpositionhint.md)


## Related topics

- [XGameUiNotificationPositionHint](https://docs.xbox.com/zh-CN/reference/system/xgameui/enums/xgameuinotificationpositionhint.md)
- [XGameUI（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xgameui/xgameui_members.md)
- [XGameUiTextEntryPositionHint](https://docs.xbox.com/zh-CN/reference/system/xgameui/enums/xgameuitextentrypositionhint.md)
- [XGameUiTextEntryUpdatePositionHint](https://docs.xbox.com/zh-CN/reference/system/xgameui/functions/xgameuitextentryupdatepositionhint.md)
- [XSpeechToTextSetPositionHint](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextsetpositionhint.md)
