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

# set_custom_user_context

> chat_user::set_custom_user_context

# chat\_user::set\_custom\_user\_context

このユーザーに対して、アプリのオプションのプライベートなカスタム ポインター サイズのコンテキスト値を設定します。

## 構文

```cpp theme={null}
void set_custom_user_context(  
    void* customUserContext  
)  
```

### パラメーター

*customUserContext*   \_In\_opt\_\
Type: void\*

`chat_user` オブジェクトに保存する任意のポインター サイズの値。

### 戻り値

Type: void

なし。

## 解説

このメソッドは、この [chat\_user](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/chat_user.md) オブジェクトに対して、アプリのオプションのプライベートなカスタム ポインター サイズのコンテキスト値を設定します。カスタム ユーザー コンテキストは通常、マッピング参照を必要とせずに、ユーザーに関連付けられたローカルのアプリ固有のメモリへのアクセスを簡素化する「ショートカット」として使用されます。`chat_user` オブジェクトのカスタム ユーザー コンテキストを取得するには、[chat\_user::custom\_user\_context](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context.md) メソッドを使用します。

カスタム ユーザー コンテキストは、Game Chat 2 ライブラリによって不透明な値として扱われ、ローカル デバイス上でのみ有効です。ネットワーク経由では送信されません。

## 要件

**ヘッダー:** GameChat2.h

**サポートされているプラットフォーム:** Windows、XBOX One ファミリ本体および XBOX Series 本体

## 関連項目

[Game Chat 2 の概要](https://docs.xbox.com/ja-jp/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro.md)\
[chat\_user](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/chat_user.md)


## Related topics

- [custom_user_context](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context.md)
- [chat_user](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_user/chat_user.md)
- [PartyLocalUser::SetCustomContext](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_setcustomcontext.md)
- [PartyXblChatUser::SetCustomContext](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_setcustomcontext.md)
- [PartyLocalUser::GetCustomContext](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getcustomcontext.md)
