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

# chat_user::set_custom_user_context

> chat_user::set_custom_user_context

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

Sets the app's optional, private, custom pointer-sized context value for this user.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

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

An arbitrary, pointer-sized value to store for the `chat_user` object.

<a id="retvalSection" />

### Return value

Type: void

None.

<a id="remarksSection" />

## Remarks

This method sets the app's optional, private, custom pointer-sized context value for this [chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user) object. The custom user context is typically used as a "shortcut" that simplifies accessing local, app-specific memory associated with the user without requiring a mapping lookup. Use the [chat\_user::custom\_user\_context](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context) method to retrieve the custom user context for a `chat_user` object.

The custom user context is treated as opaque by the Game Chat 2 library, and is only valid on the local device; it is not transmitted over the network.

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [chat_user::custom_user_context](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context.md)
- [chat_user_local::set_remote_user_muted](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_set_remote_user_muted.md)
- [PartyXblChatUser::SetCustomContext](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_setcustomcontext.md)
- [chat_user_local::set_microphone_muted](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_set_microphone_muted.md)
- [chat_user_local::set_communication_relationship](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_set_communication_relationship.md)
