OSDN Git Service

ShellExtension: SetThreadLocale() does not affect LoadString() since Vista
authorsdottaka <sdottaka@users.sourceforge.net>
Sat, 6 Jun 2015 09:56:54 +0000 (18:56 +0900)
committersdottaka <sdottaka@users.sourceforge.net>
Sat, 6 Jun 2015 09:56:54 +0000 (18:56 +0900)
--HG--
branch : stable

ShellExtension/WinMergeShell.cpp

index 19a601f..d846101 100644 (file)
@@ -111,13 +111,17 @@ public:
 
                m_lcidOld = GetThreadLocale();
 
-               int iLangId = reg.ReadDword(f_LanguageId, (DWORD) - 1);
+               int iLangId = reg.ReadDword(f_LanguageId, (DWORD)-1);
                if (iLangId != -1)
+               {
                        SetThreadLocale(MAKELCID(iLangId, SORT_DEFAULT));
+                       SetThreadUILanguage(iLangId);
+               }
        }
        ~CWinMergeTempLocale()
        {
                SetThreadLocale(m_lcidOld);
+               SetThreadUILanguage(LANGIDFROMLCID(m_lcidOld));
        }
 };