Retrieving and Managing Display Scaling Options via Windows API in C++

Hi there!

I have a couple of questions related to retrieving and managing display scaling options via Windows API in C++.

It’s necessary to retrieve the supported display scaling options (such as 100%, 125%, etc.) via C++ or the Windows API in order to adjust the scaling percentage for different screens. Currently we support 5 resolution profiles: Full HD, 4K, Ultrawide, Dual QHD, and Superwide.

  1. Is there a way to programmatically get all available scaling options for a particular display, and determine the recommended scaling percentage, as well as whether the scaling has been manually modified by the user?
  2. When changing the scaling percentage should the resolution be changed according to it or not and vice versa.

Looking forward to hearing from you soon.

Thanks

Kind regards

Shushanik

Steps to Reproduce

The engine doesn’t have anything that exposes the available Windows DPI scaling options so that’s something you’d have to access yourself via the Windows API. Though, there are some platform DPI-related functions available in the engine, such as FWindowsPlatformApplicationMisc::GetMonitorDPI(), FWindowsPlatformApplicationMisc::GetDPIScaleFactorAtPoint(), and FDisplayMetrics::RebuildDisplayMetrics().

That said, if you’re looking to scale your UI based on the user’s resolution I recommend taking a look at this page about DPI scaling in UMG: https://dev.epicgames.com/documentation/en\-us/unreal\-engine/dpi\-scaling\-in\-unreal\-engine