SetProcessDpiAwareness
SetProcessDpiAwareness is a Windows API function provided by SHCORE that sets the DPI awareness level for the current process. DPI awareness controls how a process handles DPI scaling on high-DPI displays and how it responds to changes in DPI as the user moves between monitors or changes display settings. By selecting an appropriate level, a program can influence the fidelity of its user interface and the way it loads DPI-specific resources.
The function prototype is: HRESULT SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
Parameters correspond to the PROCESS_DPI_AWARENESS enumeration, which includes values such as PROCESS_DPI_UNAWARE, PROCESS_SYSTEM_DPI_AWARE, and PROCESS_PER_MONITOR_DPI_AWARE. The
Usage notes indicate that SetProcessDpiAwareness should be called early in process initialization, before creating top-level windows
See also: SetProcessDpiAwarenessContext, DPI awareness, SHCORE, Shcore.dll.