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

# XUserPlatformSpopPromptSetEventHandlers

> XUserPlatformSpopPromptSetEventHandlers

Sets the SPOP prompt event handler.

## Syntax

```cpp theme={null}
STDAPI  XUserPlatformSpopPromptSetEventHandlers(
    _In_opt_ XTaskQueueHandle queue,
    _In_ XUserPlatformSpopPromptEventHandler* handler,
    _In_opt_ void* context
) noexcept;
```

### Parameters

*queue*   \_In\_opt\_\
Type: XTaskQueueHandle

The task queue on which XUser invokes the handler.

*handler*   \_In\_\
Type: XUserPlatformSpopPromptEventHandler

The event handler to set for SPOP prompts. See [XUserPlatformSpopPromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspopprompteventhandler.md)

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

Optional pointer that XUser passes to the handler in its *context* parameter.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

Call this function before you call [XUserAddAsync](https://docs.xbox.com/reference/system/xuser/functions/xuseraddasync.md) so that XUser can show the SPOP prompt through your handler. Calling this function again replaces the previously registered handler.

If XUser needs to show an SPOP prompt and no handler is registered, XUser completes the prompt internally with a failure result instead of asking the player to choose.

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Supported on Steam Deck

## See also

[XUser](https://docs.xbox.com/reference/system/xuser/xuser_members.md)

[XUserPlatformSpopPromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspopprompteventhandler.md)

[XUserPlatformSpopPromptComplete](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspoppromptcomplete.md)

[XUserPlatformSpopOperationResult](https://docs.xbox.com/reference/system/xuser/enums/xuserplatformspopoperationresult.md)


## Related topics

- [XUserPlatformSpopPromptEventHandler](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspopprompteventhandler.md)
- [XUserPlatformSpopPromptComplete](https://docs.xbox.com/reference/system/xuser/functions/xuserplatformspoppromptcomplete.md)
- [XUserPlatformSpopOperationResult](https://docs.xbox.com/reference/system/xuser/enums/xuserplatformspopoperationresult.md)
- [XUser Cross-Platform Support](https://docs.xbox.com/build/core-features/common/user/xuser-crossplatform.md)
- [XUser (API contents)](https://docs.xbox.com/reference/system/xuser/xuser_members.md)
