diff --git a/src/main.cpp b/src/main.cpp index 293fc3d..b40e425 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,10 +78,22 @@ FARPROC load_binary(const launcher::mode mode) return loader.load(self); } +void enable_dpi_awareness() +{ + const utils::nt::library user32{"user32.dll"}; + const auto set_dpi = user32 + ? user32.get_proc("SetProcessDpiAwarenessContext") + : nullptr; + if (set_dpi) + { + set_dpi(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + } +} + int main() { FARPROC entry_point; - SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + enable_dpi_awareness(); { auto premature_shutdown = true;