This commit is contained in:
momo5502 2022-01-15 11:15:27 +01:00
parent b9be78a102
commit 8d7d4f2d39

View File

@ -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<BOOL(WINAPI*)(DPI_AWARENESS_CONTEXT)>("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;