summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/CrashDumper/src/utils.cpp2
-rw-r--r--plugins/SpellChecker/src/utils.cpp19
2 files changed, 19 insertions, 2 deletions
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp
index 44dbff6fde..916fe00275 100644
--- a/plugins/CrashDumper/src/utils.cpp
+++ b/plugins/CrashDumper/src/utils.cpp
@@ -68,7 +68,7 @@ void GetOSDisplayString(CMString &buffer)
buffer.Append(TEXT("Windows Server 2012 "));
break;
- default:
+ case 3:
if (osvi.wProductType == VER_NT_WORKSTATION)
buffer.Append(TEXT("Windows 8.1 "));
else
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index b812ff3346..c784e56b44 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -34,7 +34,24 @@ void SetUnderline(Dialog *dlg, int pos_start, int pos_end)
cf.dwMask = CFM_UNDERLINE | CFM_UNDERLINETYPE;
cf.dwEffects = CFE_UNDERLINE;
cf.bUnderlineType = opts.underline_type + CFU_UNDERLINEDOUBLE;
- cf.bUnderlineColor = 0x05;
+
+ OSVERSIONINFOEX osvi = { 0 };
+ BOOL bOsVersionInfoEx;
+
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+
+ bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*)&osvi);
+ if (!bOsVersionInfoEx) {
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if (!GetVersionEx((OSVERSIONINFO*)&osvi))
+ return;
+ }
+
+ if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId && osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 2)
+ cf.bUnderlineColor = 0x06;
+ else
+ cf.bUnderlineColor = 0x05;
+
dlg->re->SendMessage(EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&cf);
dlg->markedSomeWord = TRUE;