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

# XblPresenceSetPresenceAsync

> XblPresenceSetPresenceAsync

# XblPresenceSetPresenceAsync

設定目前使用者內容的線上狀態資訊。

## 語法

```cpp theme={null}
HRESULT XblPresenceSetPresenceAsync(  
         XblContextHandle xblContextHandle,  
         bool isUserActiveInTitle,  
         XblPresenceRichPresenceIds* richPresenceIds,  
         XAsyncBlock* async  
)  
```

### 參數

*xblContextHandle*   \_In\_\
類型：[XblContextHandle](/zh-TW/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

本機使用者的 Xbox Live 內容。

*isUserActiveInTitle*   \_In\_\
類型：bool

指出目前的使用者內容在遊戲中目前為使用中或非使用中。應用程式可以選擇根據非使用中的時間長度來設定此值。

*richPresenceIds*   \_In\_opt\_\
類型：[XblPresenceRichPresenceIds\*](/zh-TW/reference/live/xsapi-c/presence_c/structs/xblpresencerichpresenceids)

選擇性的結構指標，用來控制 Rich Presence 字串。

*async*   \_In\_\
類型：XAsyncBlock\*

此作業的 AsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的 HRESULT 傳回碼。

## 需求

**標頭：** presence\_c.h

**程式庫：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另請參閱

[presence\_c](/zh-TW/reference/live/xsapi-c/presence_c/presence_c_members)


## Related topics

- [XblPresenceRichPresenceIds](/zh-TW/reference/live/xsapi-c/presence_c/structs/xblpresencerichpresenceids.md)
- [透過 XSAPI C 更新使用者的線上狀態](/zh-TW/services/xbox-services/community/presence/how-to/live-updating-user-presence.md)
- [選用服務](/zh-TW/build/gdk-and-engines/optional-services.md)
- [透過 REST 更新使用者的線上狀態](/zh-TW/services/xbox-services/community/presence/how-to/live-updating-presence-rest.md)
- [XblPresenceGetPresenceAsync](/zh-TW/reference/live/xsapi-c/presence_c/functions/xblpresencegetpresenceasync.md)
