From 8d7d4f2d390d36320229c5a3dd428e502f936261 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 15 Jan 2022 11:15:27 +0100 Subject: [PATCH] Fix #1 --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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;