Windows Native Toolkit

Process Window Library

External process, process-window, relaunch, and force-kill nodes.

Use this library for trusted launcher workflows, external tools, process control, and packaged-game window management.

Python examples use Unreal's reflected API names through the unreal module. Use the packaged-runtime safeguards described below before calling relaunch or force-kill helpers from Python.

Include The Modules

This page covers nodes from two plugin modules.

Source/MyProject/MyProject.Build.cs
PublicDependencyModuleNames.AddRange(
	new string[]
	{
		"Core",
		"CoreUObject",
		"Engine",
		"SystemUtilityModule",
		"DeviceFrameworkModule"
	}
);
Source/MyProject/MyClass.cpp
#include "OpenApps.h"
#include "HardwareInfoLibrary.h"

Launch App

Launches an external executable and returns the best process ID found for it.

PinDirectionDescription
ExePathInputExecutable file path to launch.
ArgumentsInputCommand-line arguments appended after the executable path.
bHiddenInputHides the launched process window when Windows allows it.
Return ValueOutputBest process ID found for the launched process tree.
C++ Example
#include "OpenApps.h"

const int32 ProcessId = UOpenApps::LaunchExternalProcess(
	TEXT("C:/Tools/MyApp.exe"),
	TEXT("--minimized"),
	true
);
Python Example
import unreal

process_id = unreal.OpenApps.launch_external_process(
    "C:/Tools/MyApp.exe",
    "--minimized",
    True,
)

Kill Process Tree

Terminates a process and its discovered child processes.

PinDirectionDescription
ProcessIDInputRoot process ID to terminate.
Return ValueOutputTrue when the root process is no longer running after the kill attempt.
C++ Example
#include "OpenApps.h"

const bool bKilled = UOpenApps::KillProcessTree(ProcessID);
Python Example
import unreal

killed = unreal.OpenApps.kill_process_tree(process_id)

Is Process Running

Checks whether a process ID is still active.

PinDirectionDescription
ProcessIDInputProcess ID to check.
Return ValueOutputTrue when the process is still running.
C++ Example
#include "OpenApps.h"

const bool bRunning = UOpenApps::IsProcessRunning(ProcessID);
Python Example
import unreal

is_running = unreal.OpenApps.is_process_running(process_id)

Focus App

Brings the main visible window for a process to the foreground.

PinDirectionDescription
ProcessIDInputProcess ID whose visible top-level window should be focused.
Return ValueOutputTrue when a matching window was found and activated.
C++ Example
#include "OpenApps.h"

const bool bFocused = UOpenApps::BringAppToFront(ProcessID);
Python Example
import unreal

focused = unreal.OpenApps.bring_app_to_front(process_id)

Can Relaunch Game

Returns whether the current runtime context safely allows relaunching the packaged game executable.

PinDirectionDescription
Return ValueOutputTrue when the runtime is not editor or commandlet and the executable path is usable.
C++ Example
#include "HardwareInfoLibrary.h"

const bool bCanRestart = USystemInfoBPLibrary::CanRestartGame();
Python Example
import unreal

can_restart = unreal.SystemInfoBPLibrary.can_restart_game()

Relaunch Game

Relaunches the packaged game executable with optional extra command-line text.

PinDirectionDescription
ExtraCommandLineInputExtra command-line text appended to the relaunched process.
C++ Example
#include "HardwareInfoLibrary.h"

USystemInfoBPLibrary::RestartGameWithCommandLine(TEXT("-myflag=value"));
Python Example
import unreal

unreal.SystemInfoBPLibrary.restart_game_with_command_line("-myflag=value")

Can Force Kill Game

Returns whether a hard process kill is allowed in the current runtime context.

PinDirectionDescription
Return ValueOutputTrue when the plugin allows immediate process termination.
C++ Example
#include "HardwareInfoLibrary.h"

const bool bCanKill = USystemInfoBPLibrary::CanForceKillGame();
Python Example
import unreal

can_force_kill = unreal.SystemInfoBPLibrary.can_force_kill_game()

Force Kill Game Process

Immediately terminates the packaged game process.

PinDirectionDescription
No pinsOutputThe current process is terminated when the runtime allows it.
C++ Example
#include "HardwareInfoLibrary.h"

USystemInfoBPLibrary::ForceKillGame();
Python Example
import unreal

unreal.SystemInfoBPLibrary.force_kill_game()

Last updated on

On this page