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

# XUserFindControllerForUserWithUiResult

> XUserFindControllerForUserWithUiResult

# XUserFindControllerForUserWithUiResult

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

## 語法

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

### 參數

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

傳送至 [XUserFindControllerForUserWithUiAsync](/zh-TW/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync) 的非同步區塊。

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

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

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

### 備註

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

## 需求

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

## 另請參閱

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


## Related topics

- [XUserFindControllerForUserWithUiResult](/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiresult.md)
- [XUserFindControllerForUserWithUiAsync](/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md)
- [Dealing with Controller Loss](/build/core-features/common/user/users-dealing-with-controller-loss.md)
- [XUser](/reference/system/xuser/xuser_members.md)
- [Tratamiento de la pérdida del mando](/es/build/core-features/common/user/users-dealing-with-controller-loss.md)
