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

# XStoreShowAssociatedProductsUIAsync

> XStoreShowAssociatedProductsUIAsync

# XStoreShowAssociatedProductsUIAsync

这将打开 Microsoft Store 应用，并显示与游戏关联的可用加载项集合。可以按产品类型进一步筛选。这是在游戏内枚举和呈现可用产品的替代方法。

<Note>请注意，此 API 会在 Web 浏览器中打开商店，如果你的游戏出现在主机、PC 上的 XBOX 应用或游戏流媒体店面中，建议使用 XStoreShowProductPageUI 或 XStoreShowPurchaseUI。</Note>

<img src="https://mintcdn.com/microsoft-4404708b/-_0FrcE2bDxzGxv-/images/gdk/reference/addonsforthisgame-small.png?fit=max&auto=format&n=-_0FrcE2bDxzGxv-&q=85&s=2d03bf5581fce6d5486ef468e2821bf6" alt="此游戏的加载项" width="600" height="332" data-path="images/gdk/reference/addonsforthisgame-small.png" />

## 语法

```cpp theme={null}
HRESULT XStoreShowAssociatedProductsUIAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char* storeId,  
         XStoreProductKind productKinds,  
         XAsyncBlock* async  
)  
```

### 参数

*storeContextHandle*   \_In\_\
类型：XStoreContextHandle

[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext) 为用户返回的商店上下文句柄。

*storeId*   \_In\_z\_\
类型：char\*

产品的 ID。

*productKinds*   \_In\_\
类型：XStoreProductKind

指示要显示的产品类型的枚举。

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

定义正在完成的异步工作的 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) 可用于轮询调用的状态并检索调用结果。有关详细信息，请参阅 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 要求

**头文件：** XStore.h

**库：** \*\*\*\*.lib
**支持的平台**：Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [在游戏中实现游戏内购买](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/pc-dev/tutorials/pc-e2e-guide/e2e-services/e2e-in-game-purchases)
* [基本商店操作](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-basic-store-operations)

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)


## Related topics

- [XStoreShowAssociatedProductsUIResult](/zh-CN/reference/system/xstore/functions/xstoreshowassociatedproductsuiresult.md)
- [商店基本操作](/zh-CN/publishing/xstore-commerce/xstore-basic-operations.md)
- [XStore](/zh-CN/reference/system/xstore/xstore_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStoreShowProductPageUIAsync](/zh-CN/reference/system/xstore/functions/xstoreshowproductpageuiasync.md)
