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

# XblUserStatisticsAddStatisticChangedHandler

> XblUserStatisticsAddStatisticChangedHandler

# XblUserStatisticsAddStatisticChangedHandler

Registers an event handler for statistic change notifications. Event handlers receive a XblStatisticChangeEventArgs object.

## Syntax

```cpp theme={null}
XblFunctionContext XblUserStatisticsAddStatisticChangedHandler(  
         XblContextHandle xblContextHandle,  
         XblStatisticChangedHandler handler,  
         void* handlerContext  
)  
```

### Parameters

*xblContextHandle*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

XBOX live context for the local user.

*handler*   \_In\_\
Type: XblStatisticChangedHandler

The callback function that receives notifications.

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

Client context pointer to be passed back to the handler.

### Return value

Type: XblFunctionContext

A XblFunctionContext object that can be used to unregister the event handler.

## Requirements

**Header:** user\_statistics\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[user\_statistics\_c](/reference/live/xsapi-c/user_statistics_c/user_statistics_c_members)


## Related topics

- [XblStatisticChangedHandler](/reference/live/xsapi-c/user_statistics_c/functions/xblstatisticchangedhandler.md)
- [Programming the RTA service](/services/xbox-services/fundamentals/rta/how-to/live-programming-rta.md)
- [Handling an event-based stat change](/services/xbox-services/player-data/stats-leaderboards/event-based/how-to/live-handling-eb-stat-change.md)
- [XblUserStatisticsRemoveStatisticChangedHandler](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsremovestatisticchangedhandler.md)
- [XblUserStatisticsTrackStatistics](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticstrackstatistics.md)
