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

# XGameUiShowPlayerPickerAsync

> XGameUiShowPlayerPickerAsync

# XGameUiShowPlayerPickerAsync

Displays a picker UI that allows a person playing the game to select players from a presented list of people.

## Syntax

```cpp theme={null}
HRESULT XGameUiShowPlayerPickerAsync(  
         XAsyncBlock* async,  
         XUserHandle requestingUser,  
         const char* promptText,  
         uint32_t selectFromPlayersCount,  
         const uint64_t* selectFromPlayers,  
         uint32_t preSelectedPlayersCount,  
         const uint64_t* preSelectedPlayers,  
         uint32_t minSelectionCount,  
         uint32_t maxSelectionCount  
)  
```

### Parameters

*async*   \_In\_<br />Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

A pointer to the [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) that is passed to [XAsyncRun](/reference/system/xasync/functions/xasyncrun).

*requestingUser*   \_In\_<br />Type: XUserHandle

A handle to the user requesting the player picker UI.

*promptText*   \_In\_z\_<br />Type: char\*

The prompt display text.

*selectFromPlayersCount*   \_In\_<br />Type: uint32\_t

The number of players that the caller can select from.

*selectFromPlayers*   \_In\_reads\_(selectFromPlayersCount)<br />Type: uint64\_t\*

A pointer to a list of player IDs that the caller can select from.

*preSelectedPlayersCount*   \_In\_<br />Type: uint32\_t

The number of players that are pre-selected when the UI is presented.

*preSelectedPlayers*   \_In\_reads\_opt\_(preSelectedPlayersCount)<br />Type: uint64\_t\*

A pointer to a list of player IDs that are pre-selected when the UI is presented.

*minSelectionCount*   \_In\_<br />Type: uint32\_t

The minimum number of people the caller must select.

*maxSelectionCount*   \_In\_<br />Type: uint32\_t

The maximum number of people the caller can select.

### Return value

Type: HRESULT

HRESULT success or error code of the async call.

To get the result, call [XGameUiShowPlayerPickerResultCount](/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount) and [XGameUiShowPlayerPickerResult](/reference/system/xgameui/functions/xgameuishowplayerpickerresult) inside the *AsyncBlock* callback or after the *AsyncBlock* is complete.

## Remarks

The player IDs must be XBOX User Ids (XUIDs), which are a *uint64\_t* value.

Calling for UI will cause your game to enter *constrained mode*. In constrained mode your title will receive fewer system resources while it is in the background of the UI that has been called for. To learn more about constrained mode and other operational modes for your title read [XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle).

## Requirements

**Header:** XGameUI.h

**Library:** xgameruntime.lib

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

## See also

[XGameUI](/reference/system/xgameui/xgameui_members)<br />[XGameUiShowPlayerPickerResult](/reference/system/xgameui/functions/xgameuishowplayerpickerresult)<br />[XGameUiShowPlayerPickerResultCount](/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount)<br />[XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle)


## Related topics

- [XGameUiShowPlayerPickerResult](/reference/system/xgameui/functions/xgameuishowplayerpickerresult.md)
- [XGameUiShowPlayerPickerUiCallback](/reference/system/xgameui/functions/xgameuishowplayerpickeruicallback.md)
- [XGameUiShowPlayerPickerResultCount](/reference/system/xgameui/functions/xgameuishowplayerpickerresultcount.md)
- [XGameUiSetPlayerPickerUiResponse](/reference/system/xgameui/functions/xgameuisetplayerpickeruiresponse.md)
- [XGameUiUiCallbacks](/reference/system/xgameui/structs/xgameuiuicallbacks.md)
