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

# XUserFindControllerForUserWithUiAsync

> XUserFindControllerForUserWithUiAsync

# XUserFindControllerForUserWithUiAsync

ユーザーに使用したいコントローラーをオンにして識別するよう促すダイアログを表示します。

## 構文

```cpp theme={null}
HRESULT XUserFindControllerForUserWithUiAsync(  
         XUserHandle user,  
         XAsyncBlock* async  
)  
```

### パラメーター

*user*   \_In\_\
Type: XUserHandle

コントローラーを検索する対象のユーザーの XUserHandle です。

*async*   \_In\_\
Type: XAsyncBlock\*

呼び出しの状態のポーリングと呼び出し結果の取得に使用する XAsyncBlock です。

### 戻り値

Type: HRESULT

HRESULT の成功またはエラー コード。エラー コードの一覧については、
[エラー コード](/reference/errorcodes) を参照してください。

### 解説

デスクトップでは、この関数は UI を表示しません。

ユーザーが選択したコントローラーの結果を取得する方法はいくつかあります。

1. [XUserFindControllerForUserWithUiResult](/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult) を呼び出します。
   これは、現在バインドされているコントローラーのデバイス ID を返します。
2. ユーザーが新しいコントローラーを選択したときに発生する [XUserDeviceAssociationChangedCallback](/reference/system/xuser/functions/xuserdeviceassociationchangedcallback)
   コールバックから結果を取得します。

## 要件

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

**ライブラリ:** xgameruntime.lib

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

## 関連項目

[XUser](/reference/system/xuser/xuser_members)\
[コントローラーの喪失への対応 (NDA topic)](/build/core-features/common/user/users-dealing-with-controller-loss)


## Related topics

- [XUserFindControllerForUserWithUiResult](/ja-jp/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult.md)
- [コントローラー損失への対処](/ja-jp/build/core-features/common/user/users-dealing-with-controller-loss.md)
- [ユーザーとコントローラーの関連付けが発生するのはいつか?](/ja-jp/build/core-features/common/user/users-timing-of-user-to-device-association.md)
- [XR-115 プレイ中のユーザーまたはコントローラーの追加と削除](/ja-jp/publishing/certification/xr/xr-115.md)
- [XBOX 認定の概要](/ja-jp/publishing/certification/overview.md)
