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

# XblSocialAddSocialRelationshipChangedHandler

> XblSocialAddSocialRelationshipChangedHandler

# XblSocialAddSocialRelationshipChangedHandler

註冊事件處理常式，以接收由註冊使用者所造成之社交關係變更的通知。

## 語法

```cpp theme={null}
XblFunctionContext XblSocialAddSocialRelationshipChangedHandler(  
         XblContextHandle xboxLiveContext,  
         XblSocialRelationshipChangedHandler handler,  
         void* handlerContext  
)  
```

### 參數

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

使用 XblContextCreateHandle 建立的 Xbox Live 內容控制代碼。

*handler*   \_In\_\
類型：XblSocialRelationshipChangedHandler

接收通知的回呼函式。

*handlerContext*   \_In\_opt\_\
類型：void\*

要傳回給處理常式的用戶端內容指標。

### 傳回值

類型：XblFunctionContext

用來移除處理常式的 XblFunctionContext。

## 備註

只有在使用者變更與其他使用者的關係時，才會觸發此處理常式。如果是其他使用者變更與此使用者的關係，則不會觸發此處理常式。請呼叫 [XblSocialRemoveSocialRelationshipChangedHandler](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialremovesocialrelationshipchangedhandler) 以取消註冊事件處理常式。

## 需求

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

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

## 另請參閱

[social\_c](/zh-TW/reference/live/xsapi-c/social_c/social_c_members)


## Related topics

- [XblSocialRemoveSocialRelationshipChangedHandler](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialremovesocialrelationshipchangedhandler.md)
- [處理社交關係變更](/zh-TW/services/xbox-services/community/people-system/how-to/live-handling-a-relationship-change.md)
- [XblSocialRelationship](/zh-TW/reference/live/xsapi-c/social_c/structs/xblsocialrelationship.md)
- [XblSocialGetSocialRelationshipsResult](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult.md)
- [XblSocialGetSocialRelationshipsAsync](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsasync.md)
