BOOL IsSortPageNeeded(LCID lcid) { /* Handle special case for Spanish (Spain) */ if (lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) || lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT)) return TRUE; userLcid = lcid; bSortPage = FALSE; EnumSystemLocalesW(SortTestEnumProc, LCID_ALTERNATE_SORTS); return bSortPage; }
static VOID InitLanguagesList( HWND hwndDlg, PGLOBALDATA pGlobalData) { WCHAR langSel[255]; hLangList = GetDlgItem(hwndDlg, IDC_LANGUAGE_COMBO); bSpain = FALSE; EnumSystemLocalesW(LocalesEnumProc, LCID_SUPPORTED); /* Select current locale */ GetLocaleInfoW(pGlobalData->SystemLCID, LOCALE_SLANGUAGE, langSel, sizeof(langSel)/sizeof(WCHAR)); SendMessageW(hLangList, CB_SELECTSTRING, -1, (LPARAM)langSel); }
static VOID CreateLanguagesList(HWND hwnd) { WCHAR langSel[255]; hList = hwnd; bSpain = FALSE; EnumSystemLocalesW(LocalesEnumProc, LCID_SUPPORTED); /* Select current locale */ /* or should it be System and not user? */ GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_SLANGUAGE, langSel, sizeof(langSel)/sizeof(WCHAR)); SendMessageW(hList, CB_SELECTSTRING, -1, (LPARAM)langSel); }
static VOID CreateSortList(HWND hwnd, LCID lcid) { WCHAR lang[255]; INT index; hWndSortList = hwnd; /* Handle special case for Spainish (Spain) */ if (lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) || lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT)) { /* Add traditional sorting */ GetLocaleInfoW(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(TCHAR)); index = SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)lang); SendMessageW(hwnd, CB_SETITEMDATA, index, (LPARAM)MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH)); /* Add modern sorting */ GetLocaleInfoW(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(TCHAR)); index = SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)lang); SendMessageW(hwnd, CB_SETITEMDATA, index, (LPARAM)MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN)); } else { userLcid = lcid; GetLocaleInfoW(lcid & 0xFFFF, LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(WCHAR)); index = SendMessageW(hWndSortList, CB_ADDSTRING, 0, (LPARAM)lang); SendMessageW(hWndSortList, CB_SETITEMDATA, index, (LPARAM)lcid & 0xFFFF); EnumSystemLocalesW(SortEnumProc, LCID_ALTERNATE_SORTS); } /* Select current locale */ /* or should it be System and not user? */ GetLocaleInfoW(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(WCHAR)); SendMessageW(hwnd, CB_SELECTSTRING, -1, (LPARAM)lang); }