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

# XUserFindControllerForUserWithUiResult

> XUserFindControllerForUserWithUiResult

# XUserFindControllerForUserWithUiResult

擷取使用者選擇使用的應用程式本機裝置識別碼 (APP\_LOCAL\_DEVICE\_ID)。

## 語法

```cpp theme={null}
HRESULT XUserFindControllerForUserWithUiResult(  
         XAsyncBlock* async,  
         APP_LOCAL_DEVICE_ID* deviceId  
)  
```

### 參數

*async*   \_Inout\_\
類型：XAsyncBlock\*

傳送至 [XUserFindControllerForUserWithUiAsync](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md) 的非同步區塊。

*deviceId*   \_Out\_\
類型：APP\_LOCAL\_DEVICE\_ID\*

目前與使用者相關聯之控制器的裝置識別碼。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](https://docs.xbox.com/zh-TW/reference/errorcodes.md)。

### 備註

在桌面上，此函式一律會傳回全為零的裝置識別碼。

## 需求

**標頭：** XUser.h\
**程式庫：** xgameruntime.lib\
**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XUser](https://docs.xbox.com/zh-TW/reference/system/xuser/xuser_members.md)\
[處理控制器遺失 (NDA 主題)](https://docs.xbox.com/zh-TW/build/core-features/common/user/users-dealing-with-controller-loss.md)


## Related topics

- [XUserFindControllerForUserWithUiAsync](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md)
- [處理控制器遺失](https://docs.xbox.com/zh-TW/build/core-features/common/user/users-dealing-with-controller-loss.md)
- [XUser (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xuser/xuser_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUserResolveIssueWithUiResult](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
