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.

Include The Modules

This page covers nodes from two plugin modules.

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

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
  );

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);

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);

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);

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();

Relaunch Game

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

Not 100% Guaranteed

This node launches a new instance of the game using the original process and then forcefully kills the current process. Because of how Windows process scheduling and anti-cheat/DRM systems work, this method is not 100% guaranteed to succeed on all machines. Test thoroughly in your target environment.

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

  USystemInfoBPLibrary::RestartGameWithCommandLine(TEXT("-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();

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();

Last updated on

On this page