# \[Windows\] application lifecycle delegates

**URL:** <https://forums.unrealengine.com/t/windows-application-lifecycle-delegates/1805988>\
**Category:** Platform & Builds\
**Tags:** wwise, unreal-engine, question, CPP\
**Created:** [April 16, 2024, 7:20am UTC](https://forums.unrealengine.com/t/windows-application-lifecycle-delegates/1805988 "2024-04-16T07:20:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WeizhaoWu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/weizhaowu/32/873106_2.png) [@WeizhaoWu](https://forums.unrealengine.com/u/WeizhaoWu)\
**Post date:** [April 16, 2024, 7:20am UTC](https://forums.unrealengine.com/t/windows-application-lifecycle-delegates/1805988/1 "2024-04-16T07:20:01Z")

</div>

Hi guys! Is there any relevant application lifecycle delegates that we can use to capture windows entering background and entering foreground?

I tried all these, but none of them works on windows.

```auto
FCoreDelegates::ApplicationWillDeactivateDelegate
FCoreDelegates::ApplicationHasReactivatedDelegate
FCoreDelegates::ApplicationWillEnterBackgroundDelegate
FCoreDelegates::ApplicationHasEnteredForegroundDelegate

```

**Unreal Engine:** 5.3  
**Test Environment:** Windows 10, Windows 11.

---

<div class="post-metadata">

**Author:** ![ashtorak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashtorak/32/870614_2.png) [@ashtorak](https://forums.unrealengine.com/u/ashtorak)\
**Post date:** [January 4, 2025, 10:55pm UTC](https://forums.unrealengine.com/t/windows-application-lifecycle-delegates/1805988/2 "2025-01-04T22:55:49Z")

</div>

Found anything out about this?

What else would one use to detect if focus has been regained when it’s paused?

---

<div class="post-metadata">

**Author:** ![ashtorak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ashtorak/32/870614_2.png) [@ashtorak](https://forums.unrealengine.com/u/ashtorak)\
**Post date:** [January 5, 2025, 10:29am UTC](https://forums.unrealengine.com/t/windows-application-lifecycle-delegates/1805988/3 "2025-01-05T10:29:44Z")

</div>

Looks like OnWindowFocusChanged is doing the trick. Found it via:

> **[Pause Game When Window Loses Focus](https://benui.ca/unreal/window-focus-change/)**
>
> Want to pause the game, reduce FPS, mute audio when the game window loses focus?

I have put UGameplayStatics::SetGamePaused(GetWorld(), true); instead of setting the max fps.

Just make sure to add the following includes:

#include \<Kismet/GameplayStatics.h\>  
#include “Framework/Application/SlateApplication.h”

and you can put this in any component for example. I put it in a dedicated component that I added to my character blueprint and it seems to work as intended. It pauses when alt tabbing and unpauses when going back 🙂
