Windows Native Toolkit

Display Mode Library

Monitor discovery, display-mode query, refresh-rate, and display-mode application nodes.

Use this library for monitor-aware settings screens and Windows display-mode control.

Python examples use Unreal's reflected API names through the unreal module. Every input argument is passed explicitly, including revert_after_seconds, to match Unreal Python binding behavior.

Monitor Selection

Leave MonitorId empty to target the monitor currently used by the Unreal game window.

Failure Reporting

Public error-message pins were removed. When a setter or test node fails, it returns false and writes the reason to the Unreal log.

Get Monitors

Returns every active Windows monitor.

PinDirectionPurpose
Return ValueOutputTArray<FWNTMonitorInfo> for all active monitors.

FWNTMonitorInfo fields:

  • MonitorId
  • Name
  • CurrentResolution
  • CurrentRefreshRate
  • NativeResolution
  • bIsPrimary
  • bIsGameWindowMonitor
C++ Example
#include "RefreshRateFunctionLibrary.h"

const TArray<FWNTMonitorInfo> Monitors = URefreshRateFunctionLibrary::GetMonitors();
Python Example
import unreal

monitors = unreal.RefreshRateFunctionLibrary.get_monitors()

Get Game Window Monitor

Returns the monitor used by the current Unreal game window.

PinDirectionPurpose
Return ValueOutputFWNTMonitorInfo for the game-window monitor.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const FWNTMonitorInfo MonitorInfo = URefreshRateFunctionLibrary::GetGameWindowMonitor();
Python Example
import unreal

monitor_info = unreal.RefreshRateFunctionLibrary.get_game_window_monitor()

Get Display Mode

Returns the current display mode for one monitor.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
Return ValueOutputFWNTDisplayMode for the selected monitor.

FWNTDisplayMode fields:

  • MonitorId
  • Resolution
  • RefreshRate
  • bIsValid
C++ Example
#include "RefreshRateFunctionLibrary.h"

const FWNTDisplayMode Mode = URefreshRateFunctionLibrary::GetCurrentDisplayMode(MonitorId);
Python Example
import unreal

mode = unreal.RefreshRateFunctionLibrary.get_current_display_mode(monitor_id)

Test Display Mode

Tests whether Windows accepts a resolution and refresh rate without applying the mode.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
ResolutionInputTarget resolution to test.
RefreshRateInputTarget refresh rate to test.
Return ValueOutputTrue when Windows accepts the display mode.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const bool bSupported =
    URefreshRateFunctionLibrary::TestDisplayMode(MonitorId, FIntPoint(2560, 1440), 144);
Python Example
import unreal

supported = unreal.RefreshRateFunctionLibrary.test_display_mode(
    monitor_id,
    unreal.IntPoint(2560, 1440),
    144,
)

Apply Display Mode

Applies a resolution and refresh rate to a monitor.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
ResolutionInputTarget resolution to apply.
RefreshRateInputTarget refresh rate to apply.
RevertAfterSecondsInputReverts to the previous mode after this delay when greater than zero.
Return ValueOutputTrue when the display mode was applied.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const bool bApplied =
    URefreshRateFunctionLibrary::ApplyDisplayMode(MonitorId, FIntPoint(1920, 1080), 120, 10.0f);
Python Example
import unreal

applied = unreal.RefreshRateFunctionLibrary.apply_display_mode(
    monitor_id,
    unreal.IntPoint(1920, 1080),
    120,
    10.0,
)

Get Native Resolution

Returns the Windows recommended resolution for a monitor.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
Return ValueOutputRecommended or native resolution.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const FIntPoint NativeResolution = URefreshRateFunctionLibrary::GetNativeResolution(MonitorId);
Python Example
import unreal

native_resolution = unreal.RefreshRateFunctionLibrary.get_native_resolution(monitor_id)

Get Supported Display Modes

Returns the unique resolutions and unique refresh rates that Windows exposes in display settings for the selected monitor.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
ResolutionsOutputTArray<FIntPoint> containing unique supported resolutions.
RefreshRatesOutputTArray<int32> containing unique supported refresh rates in hertz.
C++ Example
#include "RefreshRateFunctionLibrary.h"

TArray<FIntPoint> Resolutions;
TArray<int32> RefreshRates;
URefreshRateFunctionLibrary::GetSupportedDisplayModes(MonitorId, Resolutions, RefreshRates);
Python Example
import unreal

resolutions, refresh_rates = unreal.RefreshRateFunctionLibrary.get_supported_display_modes(monitor_id)

Get Refresh Rate

Returns the current refresh rate for one monitor.

PinDirectionPurpose
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
Return ValueOutputCurrent refresh rate in hertz.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const int32 RefreshRate = URefreshRateFunctionLibrary::GetCurrentRefreshRate(MonitorId);
Python Example
import unreal

refresh_rate = unreal.RefreshRateFunctionLibrary.get_current_refresh_rate(monitor_id)

Set Refresh Rate

Sets the refresh rate for one monitor while keeping its current resolution.

PinDirectionPurpose
NewRefreshRateInputTarget refresh rate in hertz.
MonitorIdInputMonitor device ID. Leave empty to use the game-window monitor.
Return ValueOutputTrue when the refresh-rate change succeeded.
C++ Example
#include "RefreshRateFunctionLibrary.h"

const bool bChanged = URefreshRateFunctionLibrary::SetRefreshRate(144, MonitorId);
Python Example
import unreal

changed = unreal.RefreshRateFunctionLibrary.set_refresh_rate(144, monitor_id)

Last updated on

On this page