3 * Copyright (C) 2007 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * FILE: dll/win32/input/add.c
24 * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
44 /*struct LangAndLayout
51 char *SubLang[133] = {}
53 VOID CreateLangStruct(VOID)
58 for(Count = 0; Count < END_LAYOUT - BEGIN_LAYOUT; Count++)
63 sizeof(Layout) / sizeof(TCHAR));
64 strcpy(VarLang[Count].Layout,Layout);
68 /* Language enumerate procedure */
71 LanguagesEnumProc(LPTSTR lpLanguage
)
77 Lcid
= _tcstoul(lpLanguage
, NULL
, 16);
79 GetLocaleInfo(Lcid
, LOCALE_SLANGUAGE
, Lang
, sizeof(Lang
));
80 Index
= (INT
)SendMessage(hLanguageList
,
85 SendMessage(hLanguageList
,
93 /* Enumerate all installed language identifiers */
96 CreateLanguagesList(HWND hWnd
)
100 hLanguageList
= hWnd
;
101 EnumSystemLocales(LanguagesEnumProc
, LCID_INSTALLED
);
103 /*SendMessage(hLanguageList,
111 SelectCurrentLayout(HWND hWnd
)
122 AddDlgProc(HWND hDlg
,
127 UNREFERENCED_PARAMETER(lParam
);
132 CreateLanguagesList(GetDlgItem(hDlg
, IDC_INPUT_LANGUAGE_COMBO
));
133 CreateKeyboardLayoutList(GetDlgItem(hDlg
, IDC_KEYBOARD_LAYOUT_COMBO
));
134 SelectCurrentLayout(GetDlgItem(hDlg
, IDC_KEYBOARD_LAYOUT_COMBO
));
138 switch (LOWORD(wParam
))
140 case IDC_INPUT_LANGUAGE_COMBO
:
141 if (HIWORD(wParam
) == CBN_SELCHANGE
)
143 SelectCurrentLayout(GetDlgItem(hDlg
, IDC_KEYBOARD_LAYOUT_COMBO
));
151 EndDialog(hDlg
, LOWORD(wParam
));