From 0174b54e00f5b2a9693e0b1ab0a4f569ff517a3a Mon Sep 17 00:00:00 2001
From: mikalair <mikalair@outlook.com>
Date: Wed, 23 Aug 2017 17:40:30 +0300
Subject: fix xp support

---
 src/mir_app/src/modules.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp
index 46892c6837..ff9117276b 100644
--- a/src/mir_app/src/modules.cpp
+++ b/src/mir_app/src/modules.cpp
@@ -94,9 +94,15 @@ int LoadDefaultModules(void)
 	// load database drivers & service plugins without executing their Load()
 	if (LoadNewPluginsModuleInfos()) return 1;
 
-	if (GetPrivateProfileInt(L"Interface", L"DpiAware", 0, mirandabootini) == 1)
-		SetProcessDPIAware();
+	if (GetPrivateProfileInt(L"Interface", L"DpiAware", 0, mirandabootini) == 1) {
+		typedef BOOL (WINAPI  * SetProcessDPIAware_t)(void);
 
+		SetProcessDPIAware_t pfn = (SetProcessDPIAware_t)GetProcAddress(GetModuleHandleW(L"user32"), "SetProcessDPIAware");
+		if (pfn != nullptr) {
+			pfn();
+		}
+	}
+	
 	switch (LoadDefaultServiceModePlugin()) {
 	case SERVICE_CONTINUE:  // continue loading Miranda normally
 	case SERVICE_ONLYDB:    // load database and go to the message cycle
-- 
cgit v1.2.3