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

# XGameUiSetNotificationPositionHint

> XGameUiSetNotificationPositionHint

# XGameUiSetNotificationPositionHint

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

## 语法

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

### 参数

*position*   \_In\_\
类型：[XGameUiNotificationPositionHint](/reference/system/xgameui/enums/xgameuinotificationpositionhint)

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

### 返回值

类型：HRESULT

## 备注

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

通知位置是对操作系统显示 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](/reference/system/xgameui/xgameui_members)\
[XGameUiNotificationPositionHint](/reference/system/xgameui/enums/xgameuinotificationpositionhint)


## Related topics

- [XGameUiNotificationPositionHint](/zh-CN/reference/system/xgameui/enums/xgameuinotificationpositionhint.md)
- [XGameUI](/zh-CN/reference/system/xgameui/xgameui_members.md)
- [XGameUiTextEntryPositionHint](/zh-CN/reference/system/xgameui/enums/xgameuitextentrypositionhint.md)
- [XGameUiTextEntryUpdatePositionHint](/zh-CN/reference/system/xgameui/functions/xgameuitextentryupdatepositionhint.md)
- [XSpeechToTextSetPositionHint](/zh-CN/reference/system/xaccessibility/functions/xspeechtotextsetpositionhint.md)
