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/settings.c
24 * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
46 CreateDefaultLangList(HWND hWnd
)
49 TCHAR szPreload
[BUFSIZE
];
50 TCHAR szCount
[BUFSIZE
];
59 if(RegOpenKeyEx(HKEY_CURRENT_USER
, TEXT("Keyboard Layout\\Preload"), 0, KEY_QUERY_VALUE
, &hKey
) != ERROR_SUCCESS
)
64 RegQueryInfoKey(hKey
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,&cValues
,NULL
,NULL
,NULL
,NULL
);
68 for (Count
= 0; Count
< cValues
; Count
++)
70 szCount
[0] = TEXT('\0');
73 lRet
= RegEnumValue(hKey
,Count
,(LPTSTR
)szCount
,&dwBufCLen
,NULL
,NULL
,NULL
,NULL
);
75 _stprintf(szCount
,TEXT("%d"),Count
+ 1);
78 RegQueryValueEx(hKey
,(LPTSTR
)szCount
,NULL
,NULL
,(LPBYTE
)szPreload
,&dwBufLen
);
80 Lcid
= _tcstoul(szPreload
, NULL
, 16);
81 GetLocaleInfo(Lcid
, LOCALE_SLANGUAGE
, (LPTSTR
)Lang
, sizeof(Lang
));
103 /* Property page dialog callback */
105 SettingPageProc(HWND hwndDlg
,UINT uMsg
,WPARAM wParam
,LPARAM lParam
)
107 UNREFERENCED_PARAMETER(lParam
);
112 CreateDefaultLangList(GetDlgItem(hwndDlg
, IDC_DEFAULT_INPUT_LANG
));
116 switch (LOWORD(wParam
))
118 case IDC_LANG_BAR_BUTTON
:
120 MAKEINTRESOURCE(IDD_LANGBAR
),
125 case IDC_KEY_SETTINGS_BUTTON
:
127 MAKEINTRESOURCE(IDD_KEYSETTINGS
),
134 MAKEINTRESOURCE(IDD_ADD
),
139 case IDC_PROP_BUTTON
:
141 MAKEINTRESOURCE(IDD_INPUT_LANG_PROP
),
143 InputLangPropDlgProc
);
146 case IDC_DEFAULT_INPUT_LANG
:
147 if (HIWORD(wParam
) == CBN_SELCHANGE
)
149 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);