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

# XDisplayCloseTimeoutDeferralHandle

> XDisplayCloseTimeoutDeferralHandle

# XDisplayCloseTimeoutDeferralHandle

以前に [XDisplayAcquireTimeoutDeferral](/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral) を呼び出して取得した画面タイムアウトの延期を解放します。

## Syntax

```cpp theme={null}
void XDisplayCloseTimeoutDeferralHandle(  
         XDisplayTimeoutDeferralHandle handle  
)  
```

### Parameters

*handle*   \_In\_\
型: XDisplayTimeoutDeferralHandle

閉じる画面タイムアウトの延期のハンドル。

### Return value

型: void

## Remarks

<Note>この関数は、タイム センシティブ スレッドから呼び出しても安全ではありません。詳細については、[Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads) を参照してください。</Note>

画面タイムアウトの延期により、ユーザーが何も操作しない間も画面が暗くなったり、ロックされたり、電源が切れたりしないようにします。一定のアイドル時間が経過すると、画面タイムアウトが発生します。画面タイムアウトが発生すると、デバイスはディスプレイを暗くしたり、ロック画面をアクティブにしたり、ディスプレイの電源を切ったりする場合があります。画面タイムアウトが発生するのに必要なアイドル時間の長さは、デバイスのユーザー設定によって異なります。ゲームがユーザーの操作を必要としないアクティビティ (ゲーム リソースの読み込みや長いカットシーンの表示など) を実行している場合、画面タイムアウトは不便な場合があります。画面タイムアウトの延期を取得することで、画面タイムアウトを防止できます。

画面タイムアウトの延期を取得するには、まず [XDisplayAcquireTimeoutDeferral](/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral) を呼び出して画面タイムアウトの延期のハンドルを取得し、そのハンドルが不要になったら **XDisplayCloseTimeoutDeferralHandle** を呼び出してハンドルを閉じます。ゲームがフォーカスを失うと画面タイムアウトの延期は無視され、ゲームが終了すると解放されます。

<Note>[XDisplayAcquireTimeoutDeferral](/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral) を使用して画面タイムアウトの延期ハンドルを取得した場合は、この関数を呼び出してそのハンドルを閉じる必要があります。複数の画面タイムアウトの延期ハンドルを取得することができ、すべての画面タイムアウトの延期ハンドルが閉じられた後にのみ、ゲームで画面タイムアウトが有効になります。</Note>

次の例では、[XDisplayAcquireTimeoutDeferral](/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral) を呼び出して新しい画面タイムアウトの延期ハンドルを取得した後、長い導入カットシーンを再生します。新しいハンドルが正常に取得された場合、ユーザーの非操作による画面タイムアウトなしで長い導入カットシーンを再生できます。カットシーンの再生が完了したら、この例は **XDisplayCloseTimeoutDeferralHandle** を呼び出してハンドルを閉じます。すべての画面タイムアウトの延期ハンドルが閉じられた後は、ユーザーの非操作による画面タイムアウトが再び発生する可能性があります。

```cpp theme={null}
void Game::PlayIntroCutscene()
{
    XDisplayTimeoutDeferralHandle handle;

    // Try to acquire a new timeout deferral handle.
    if (SUCCEEDED(XDisplayAcquireTimeoutDeferral(&handle)))
    {
        // The newly-opened timeout deferral handle prevents the display
        // from dimming over the game if the user goes idle.
        // 
        // At this point, the long intro cutscene can play without dimmming.
    }

    // Once the cutscene has completed playing, 
    // close the timeout deferral handle.
    XDisplayCloseTimeoutDeferralHandle(handle);

    // If there are no open timeout deferral handles, the display can
    // once again dim over the game if the user goes idle.
}
```

## Requirements

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

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

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

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XDisplayAcquireTimeoutDeferral](/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral)\
[XDisplay](/reference/system/xdisplay/xdisplay_members)


## Related topics

- [XDisplayAcquireTimeoutDeferral](/ja-jp/reference/system/xdisplay/functions/xdisplayacquiretimeoutdeferral.md)
- [XDisplay](/ja-jp/reference/system/xdisplay/xdisplay_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUserCloseSignOutDeferralHandle](/ja-jp/reference/system/xuser/functions/xuserclosesignoutdeferralhandle.md)
- [XUserCloseHandle](/ja-jp/reference/system/xuser/functions/xuserclosehandle.md)
