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

# XStoreShowRateAndReviewUIAsync

> XStoreShowRateAndReviewUIAsync

# XStoreShowRateAndReviewUIAsync

顯示快顯系統對話方塊，讓使用者為目前的遊戲提供評論或拒絕評論。

## 語法

```cpp theme={null}
HRESULT XStoreShowRateAndReviewUIAsync(  
         const XStoreContextHandle storeContextHandle,  
         XAsyncBlock* async  
)  
```

### 參數

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

由 [XStoreCreateContext](/zh-TW/reference/system/xstore/functions/xstorecreatecontext) 傳回的使用者商店內容控制代碼。

*async*   \_Inout\_\
類型：[XAsyncBlock\*](/zh-TW/reference/system/xasync/structs/xasyncblock)

定義正在執行之非同步工作的 [XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock)。[XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock) 可用來輪詢呼叫的狀態並擷取呼叫結果。如需詳細資訊，請參閱 [XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock)。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

若要擷取此函式的執行結果，請在呼叫此函式之後呼叫 [XStoreShowRateAndReviewUIResult](/zh-TW/reference/system/xstore/functions/xstoreshowrateandreviewuiresult)。

如果系統偵測到遊戲過度呼叫此函式，將會隱藏對話方塊並自動傳回 **CanceledByUser**。

下列程式碼片段示範顯示評論對話方塊的範例。

```cpp theme={null}
void CALLBACK ShowRateAndReviewUICallback(XAsyncBlock* asyncBlock)
{
    XStoreRateAndReviewResult result{};
    HRESULT hr = XStoreShowRateAndReviewUIResult(
        asyncBlock,
        &result);

    if (FAILED(hr))
    {
        printf("Failed to rate and review: 0x%x\r\n", hr);
        return;
    }

    printf("result.wasUpdated: %s\r\n", result.wasUpdated ? "true" : "false");
}

void ShowRateAndReviewUI(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = ShowRateAndReviewUICallback;

    HRESULT hr = XStoreShowRateAndReviewUIAsync(
        storeContextHandle,
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed rate and review: 0x%x\r\n", hr);
        return;
    }
}

```

## 需求

**標頭：** XStore.h (包含在 XGameRuntime.h 中)

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XStore](/zh-TW/reference/system/xstore/xstore_members)\
[XStoreShowRateAndReviewUIResult](/zh-TW/reference/system/xstore/functions/xstoreshowrateandreviewuiresult)


## Related topics

- [XStoreShowRateAndReviewUIAsync](/reference/system/xstore/functions/xstoreshowrateandreviewuiasync.md)
- [XStoreShowRateAndReviewUIResult](/reference/system/xstore/functions/xstoreshowrateandreviewuiresult.md)
- [XStoreRateAndReviewResult](/reference/system/xstore/structs/xstorerateandreviewresult.md)
- [XStore](/reference/system/xstore/xstore_members.md)
