From f4c08e94a72ecc7d147c6e760ed76e33e38f3f84 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 3 Jan 2015 09:58:04 +0000 Subject: SpellCheker: fix for red underline color Crasgdumper: fix for win 8.1 detect git-svn-id: http://svn.miranda-ng.org/main/trunk@11732 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CrashDumper/src/utils.cpp | 2 +- plugins/SpellChecker/src/utils.cpp | 19 ++++++++++++++++++- 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; -- cgit v1.2.3