win32: try this to fix compilation on older sdks
This commit is contained in:
parent
c73cc81494
commit
4b4b307f0e
|
@ -25,6 +25,7 @@
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <Winuser.h>
|
#include <Winuser.h>
|
||||||
|
#include <Winnls.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <commdlg.h>
|
#include <commdlg.h>
|
||||||
|
@ -1056,12 +1057,18 @@ typedef int (WINAPI *setLanguageFunc)(LANGID id);
|
||||||
|
|
||||||
void SetLanguage(int langid)
|
void SetLanguage(int langid)
|
||||||
{
|
{
|
||||||
OSVERSIONINFO info;
|
|
||||||
ZeroMemory(&info, sizeof(info));
|
HMODULE kernel32 = LoadLibrary("kernel32.dll");
|
||||||
info.dwOSVersionInfoSize = sizeof(info);
|
FARPROC _setThreadUILanguage = (FARPROC)GetProcAddress(kernel32,"SetThreadUILanguage");
|
||||||
GetVersionEx(&info);
|
|
||||||
setLanguageFunc setLanguage = ((info.dwMajorVersion >= 6) ?
|
//OSVERSIONINFO info;
|
||||||
(setLanguageFunc)SetThreadUILanguage : (setLanguageFunc)SetThreadLocale);
|
//ZeroMemory(&info, sizeof(info));
|
||||||
|
//info.dwOSVersionInfoSize = sizeof(info);
|
||||||
|
//GetVersionEx(&info);
|
||||||
|
//setLanguageFunc setLanguage = ((info.dwMajorVersion >= 6) ?
|
||||||
|
// (setLanguageFunc)_setThreadUILanguage : (setLanguageFunc)SetThreadLocale);
|
||||||
|
|
||||||
|
setLanguageFunc setLanguage = _setThreadUILanguage?(setLanguageFunc)_setThreadUILanguage:(setLanguageFunc)SetThreadLocale;
|
||||||
|
|
||||||
switch(langid)
|
switch(langid)
|
||||||
{
|
{
|
||||||
|
@ -1080,6 +1087,8 @@ void SetLanguage(int langid)
|
||||||
default: break;
|
default: break;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreeLibrary(kernel32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveLanguage(int langid)
|
void SaveLanguage(int langid)
|
||||||
|
|
Loading…
Reference in New Issue