ReactOS 0.4.15-dev-7942-gd23573b
settings_page.c
Go to the documentation of this file.
1/*
2 * PROJECT: input.dll
3 * FILE: dll/cpl/input/settings_page.c
4 * PURPOSE: input.dll
5 * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org)
6 * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
9#include "input.h"
10#include "layout_list.h"
11#include "locale_list.h"
12#include "input_list.h"
13
15static INT s_nRootCount = 0;
17static INT s_iDotImage = -1;
18
19static HICON
21{
22 WCHAR szBuf[4];
23 HDC hdcScreen, hdc;
24 HBITMAP hbmColor, hbmMono, hBmpOld;
25 HFONT hFont, hFontOld;
26 LOGFONTW lf;
27 RECT rect;
32
33 /* Getting "EN", "FR", etc. from English, French, ... */
36 szBuf,
37 ARRAYSIZE(szBuf)) == 0)
38 {
39 szBuf[0] = szBuf[1] = L'?';
40 }
41 szBuf[2] = UNICODE_NULL; /* Truncate the identifier to two characters: "ENG" --> "EN" etc. */
42
43 /* Create hdc, hbmColor and hbmMono */
44 hdcScreen = GetDC(NULL);
45 hdc = CreateCompatibleDC(hdcScreen);
46 hbmColor = CreateCompatibleBitmap(hdcScreen, cxIcon, cyIcon);
47 ReleaseDC(NULL, hdcScreen);
48 hbmMono = CreateBitmap(cxIcon, cyIcon, 1, 1, NULL);
49
50 /* Checking NULL */
51 if (!hdc || !hbmColor || !hbmMono)
52 {
53 if (hbmMono)
54 DeleteObject(hbmMono);
55 if (hbmColor)
56 DeleteObject(hbmColor);
57 if (hdc)
59 return NULL;
60 }
61
62 /* Create a font */
63 hFont = NULL;
64 if (SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0))
65 {
66 /* Override the current size with something manageable */
67 lf.lfHeight = -11;
68 lf.lfWidth = 0;
70 }
71 if (!hFont)
73
74 SetRect(&rect, 0, 0, cxIcon, cyIcon);
75
76 /* Draw hbmColor */
77 hBmpOld = SelectObject(hdc, hbmColor);
79 FillRect(hdc, &rect, (HBRUSH)GetStockObject(DC_BRUSH));
80 hFontOld = SelectObject(hdc, hFont);
84 SelectObject(hdc, hFontOld);
85
86 /* Fill hbmMono with black */
87 SelectObject(hdc, hbmMono);
88 PatBlt(hdc, 0, 0, cxIcon, cyIcon, BLACKNESS);
89 SelectObject(hdc, hBmpOld);
90
91 /* Create an icon from hbmColor and hbmMono */
94 IconInfo.hbmColor = hbmColor;
95 IconInfo.hbmMask = hbmMono;
97
98 /* Clean up */
100 DeleteObject(hbmMono);
101 DeleteObject(hbmColor);
102 DeleteDC(hdc);
103
104 return hIcon;
105}
106
108{
109 WCHAR szText[256];
110 INPUT_LIST_NODE *pNode;
111 INT iIndex, nCount, iDefault = (INT)SendMessageW(hwndCombo, CB_GETCURSEL, 0, 0);
112
113 SendMessageW(hwndCombo, CB_RESETCONTENT, 0, 0);
114
115 for (pNode = InputList_GetFirst(); pNode != NULL; pNode = pNode->pNext)
116 {
118 continue;
119
120 StringCchPrintfW(szText, _countof(szText), L"%s - %s",
121 pNode->pLocale->pszName, pNode->pLayout->pszName);
122 iIndex = (INT)SendMessageW(hwndCombo, CB_ADDSTRING, 0, (LPARAM)szText);
123 SendMessageW(hwndCombo, CB_SETITEMDATA, iIndex, (LPARAM)pNode);
124
125 if (pNode->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT)
126 iDefault = iIndex;
127 }
128
129 nCount = (INT)SendMessageW(hwndCombo, CB_GETCOUNT, 0, 0);
130 if (iDefault >= nCount)
131 SendMessageW(hwndCombo, CB_SETCURSEL, nCount - 1, 0);
132 else
133 SendMessageW(hwndCombo, CB_SETCURSEL, iDefault, 0);
134}
135
136static VOID
138{
139 HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST);
140 HWND hwndCombo = GetDlgItem(hwndDlg, IDC_DEFAULT_LANGUAGE);
141 BOOL bIsLeaf, bCanRemove, bCanProp;
142 HTREEITEM hSelected = TreeView_GetSelection(hwndList);
144 item.hItem = hSelected;
145
146 bIsLeaf = (hSelected && TreeView_GetItem(hwndList, &item) && HIWORD(item.lParam));
147
148 bCanRemove = (bIsLeaf && (s_nAliveLeafCount > 1)) || (s_nRootCount > 1);
149 bCanProp = bIsLeaf;
150
151 EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_BUTTON), bCanRemove);
152 EnableWindow(GetDlgItem(hwndDlg, IDC_PROP_BUTTON), bCanProp);
153
154 InitDefaultLangComboBox(hwndCombo);
155}
156
157static BOOL CALLBACK
159{
160 HICON* phIconSm = (HICON*)lParam;
161 if (*phIconSm)
162 return FALSE;
163
164 *phIconSm = (HICON)LoadImageW(hModule, lpszName, IMAGE_ICON,
167 0);
168 return TRUE;
169}
170
171static HICON LoadIMEIcon(LPCTSTR pszImeFile)
172{
173 WCHAR szSysDir[MAX_PATH], szPath[MAX_PATH];
174 HINSTANCE hImeInst;
176
177 GetSystemDirectoryW(szSysDir, _countof(szSysDir));
178 StringCchPrintfW(szPath, _countof(szPath), L"%s\\%s", szSysDir, pszImeFile);
179
181 if (hImeInst == NULL)
182 return NULL;
183
185 FreeLibrary(hImeInst);
186
187 return hIconSm;
188}
189
190static HTREEITEM FindLanguageInList(HWND hwndList, LPCTSTR pszLangName)
191{
193 TCHAR szText[128];
195
196 hItem = TreeView_GetRoot(hwndList);
197 while (hItem)
198 {
199 szText[0] = 0;
200 item.mask = TVIF_TEXT | TVIF_HANDLE;
201 item.pszText = szText;
202 item.cchTextMax = _countof(szText);
203 item.hItem = hItem;
204 TreeView_GetItem(hwndList, &item);
205 if (_wcsicmp(szText, pszLangName) == 0)
206 return hItem;
207
209 }
210
211 return NULL;
212}
213
214static VOID
216{
219 HIMAGELIST hImageList = TreeView_GetImageList(hwndList, TVSIL_NORMAL);
220 WCHAR szKeyboard[64];
222 BOOL bBold = !!(pInputNode->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT);
223
224 hItem = FindLanguageInList(hwndList, pInputNode->pLocale->pszName);
225 if (hItem == NULL)
226 {
227 // Language icon
228 INT LangImageIndex = -1;
229 HICON hLangIcon = CreateLayoutIcon(LOWORD(pInputNode->pLocale->dwId));
230 if (hLangIcon)
231 {
232 LangImageIndex = ImageList_AddIcon(hImageList, hLangIcon);
233 DestroyIcon(hLangIcon);
234 }
235
236 // Language
237 ZeroMemory(&item, sizeof(item));
239 item.pszText = pInputNode->pLocale->pszName;
240 item.iImage = LangImageIndex;
241 item.iSelectedImage = LangImageIndex;
242 item.lParam = LOWORD(pInputNode->pLocale->dwId); // HIWORD(item.lParam) == 0
243 if (bBold)
244 {
245 item.state = item.stateMask = TVIS_BOLD;
246 }
247 insert.hParent = TVI_ROOT;
248 insert.hInsertAfter = TVI_LAST;
249 insert.item = item;
250 hItem = TreeView_InsertItem(hwndList, &insert);
251
252 // The type of input method (currently keyboard only)
253 LoadStringW(hApplet, IDS_KEYBOARD, szKeyboard, _countof(szKeyboard));
254 ZeroMemory(&item, sizeof(item));
256 item.pszText = szKeyboard;
257 item.iImage = s_iKeyboardImage;
258 item.iSelectedImage = s_iKeyboardImage;
259 item.lParam = 0; // HIWORD(item.lParam) == 0
260 insert.hParent = hItem;
261 insert.hInsertAfter = TVI_LAST;
262 insert.item = item;
263 hItem = TreeView_InsertItem(hwndList, &insert);
264 }
265 else
266 {
267 // Language
268 ZeroMemory(&item, sizeof(item));
269 item.mask = TVIF_STATE | TVIF_HANDLE;
270 item.hItem = hItem;
271 item.stateMask = TVIS_BOLD;
272 if (TreeView_GetItem(hwndList, &item) && bBold && !(item.state & TVIS_BOLD))
273 {
274 // Make the item bold
275 item.mask = TVIF_STATE | TVIF_HANDLE;
276 item.hItem = hItem;
277 item.state = item.stateMask = TVIS_BOLD;
278 TreeView_SetItem(hwndList, &item);
279 }
280
281 // The type of input method (currently keyboard only)
282 hItem = TreeView_GetChild(hwndList, hItem);
283 }
284
285 // Input method
286 if (hItem)
287 {
288 INT ImeImageIndex = s_iDotImage;
289 if (IS_IME_HKL(pInputNode->hkl) && pInputNode->pLayout->pszImeFile) // IME?
290 {
291 HICON hImeIcon = LoadIMEIcon(pInputNode->pLayout->pszImeFile);
292 if (hImeIcon)
293 {
294 ImeImageIndex = ImageList_AddIcon(hImageList, hImeIcon);
295 DestroyIcon(hImeIcon);
296 }
297 }
298
299 ZeroMemory(&item, sizeof(item));
301 item.pszText = pInputNode->pLayout->pszName;
302 item.iImage = ImeImageIndex;
303 item.iSelectedImage = ImeImageIndex;
304 item.lParam = (LPARAM)pInputNode; // HIWORD(item.lParam) != 0
305 if (bBold)
306 {
307 item.state = item.stateMask = TVIS_BOLD; // Make the item bold
308 }
309 insert.hParent = hItem;
310 insert.hInsertAfter = TVI_LAST;
311 insert.item = item;
312 hItem = TreeView_InsertItem(hwndList, &insert);
313 }
314}
315
317{
318 TreeView_Expand(hwndTree, hItem, TVE_EXPAND);
319 hItem = TreeView_GetChild(hwndTree, hItem);
320 while (hItem)
321 {
322 ExpandTreeItem(hwndTree, hItem);
324 }
325}
326
327static VOID
329{
330 INPUT_LIST_NODE *pNode;
331 HIMAGELIST hImageList = TreeView_GetImageList(hwndList, TVSIL_NORMAL);
333 HICON hKeyboardIcon, hDotIcon;
334
335 ImageList_RemoveAll(hImageList);
336 TreeView_DeleteAllItems(hwndList);
337
338 // Add keyboard icon
339 s_iKeyboardImage = -1;
342 0);
343 if (hKeyboardIcon)
344 {
345 s_iKeyboardImage = ImageList_AddIcon(hImageList, hKeyboardIcon);
346 DestroyIcon(hKeyboardIcon);
347 }
348
349 // Add dot icon
350 s_iDotImage = -1;
353 0);
354 if (hDotIcon)
355 {
356 s_iDotImage = ImageList_AddIcon(hImageList, hDotIcon);
357 DestroyIcon(hDotIcon);
358 }
359
361
363
364 // Add items to the list
365 for (pNode = InputList_GetFirst(); pNode; pNode = pNode->pNext)
366 {
368 continue;
369
370 AddToInputListView(hwndList, pNode);
371 }
372
373 // Expand all (with counting s_nRootCount)
374 s_nRootCount = 0;
375 hItem = TreeView_GetRoot(hwndList);
376 while (hItem)
377 {
378 ++s_nRootCount;
379 ExpandTreeItem(hwndList, hItem);
381 }
382
383 // Redraw
384 InvalidateRect(hwndList, NULL, TRUE);
385}
386
387static VOID
389{
390 HWND hwndInputList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST);
391 HIMAGELIST hLayoutImageList, hOldImageList;
392
396
398
401 ILC_COLOR8 | ILC_MASK, 0, 0);
402 if (hLayoutImageList != NULL)
403 {
404 hOldImageList = TreeView_SetImageList(hwndInputList, hLayoutImageList, TVSIL_NORMAL);
405 ImageList_Destroy(hOldImageList);
406 }
407
408 UpdateInputListView(hwndInputList);
409
410 SetControlsState(hwndDlg);
411}
412
413
414static VOID
416{
420}
421
422
423VOID
425{
426 switch (LOWORD(wParam))
427 {
428 case IDC_ADD_BUTTON:
429 {
432 hwndDlg,
434 {
436 SetControlsState(hwndDlg);
437 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
438 }
439 }
440 break;
441
443 {
444 HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST);
445 if (hwndList)
446 {
449 item.hItem = hItem;
450
451 if (hItem && TreeView_GetItem(hwndList, &item))
452 {
453 if (item.lParam == 0) // Branch? (currently branch is keyboard only)
454 {
455 // Get root of branch
456 item.hItem = TreeView_GetParent(hwndList, hItem);
457 TreeView_GetItem(hwndList, &item);
458 }
459
460 if (HIWORD(item.lParam)) // Leaf?
461 {
464 }
465 else // Root?
466 {
469 }
470
471 UpdateInputListView(hwndList);
472 SetControlsState(hwndDlg);
473 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
474 }
475 }
476 }
477 break;
478
479 case IDC_PROP_BUTTON:
480 {
481 HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST);
482 if (hwndList)
483 {
486 item.hItem = hItem;
487
488 if (hItem && TreeView_GetItem(hwndList, &item) && HIWORD(item.lParam))
489 {
492 hwndDlg,
494 item.lParam) == IDOK)
495 {
496 UpdateInputListView(hwndList);
497 SetControlsState(hwndDlg);
498 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
499 }
500 }
501 }
502 }
503 break;
504
505 case IDC_KEY_SET_BTN:
506 {
509 hwndDlg,
511 }
512 break;
513
514 case IDC_LANGUAGE_BAR:
515 {
516 // FIXME
517 break;
518 }
519
521 {
522 if (HIWORD(wParam) == CBN_SELENDOK)
523 {
524 HWND hwndList = GetDlgItem(hwndDlg, IDC_KEYLAYOUT_LIST);
525 HWND hwndCombo = GetDlgItem(hwndDlg, IDC_DEFAULT_LANGUAGE);
526 INT iSelected = (INT)SendMessageW(hwndCombo, CB_GETCURSEL, 0, 0);
527 if (iSelected != CB_ERR)
528 {
529 LPARAM lParam = SendMessageW(hwndCombo, CB_GETITEMDATA, iSelected, 0);
530 if (lParam)
531 {
533 if (!(pNode->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT))
534 {
537 UpdateInputListView(hwndList);
538 SetControlsState(hwndDlg);
539 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
540 }
541 }
542 }
543 }
544 }
545 }
546}
547
549{
550 HANDLE hToken;
551 LUID luid;
552 TOKEN_PRIVILEGES tokenPrivileges;
553 BOOL Ret;
554
557 &hToken);
558 if (!Ret)
559 return Ret; // failure
560
561 Ret = LookupPrivilegeValueW(NULL, lpPrivilegeName, &luid);
562 if (Ret)
563 {
564 tokenPrivileges.PrivilegeCount = 1;
565 tokenPrivileges.Privileges[0].Luid = luid;
566 tokenPrivileges.Privileges[0].Attributes = bEnable ? SE_PRIVILEGE_ENABLED : 0;
567
568 Ret = AdjustTokenPrivileges(hToken, FALSE, &tokenPrivileges, 0, 0, 0);
569 }
570
571 CloseHandle(hToken);
572 return Ret;
573}
574
575static INT_PTR
577{
579
580 switch (header->code)
581 {
582 case TVN_SELCHANGED:
583 {
584 SetControlsState(hwndDlg);
585 break;
586 }
587
589 {
590 // FIXME: Prevent collapse (COMCTL32 is buggy)
591 // https://bugs.winehq.org/show_bug.cgi?id=53727
592 NM_TREEVIEW* pTreeView = (NM_TREEVIEW*)lParam;
593 if ((pTreeView->action & TVE_TOGGLE) == TVE_COLLAPSE)
594 {
596 return TRUE;
597 }
598 break;
599 }
600
601 case PSN_APPLY:
602 {
603 /* Write Input Methods list to registry */
605 break;
606 }
607 }
608
609 return 0;
610}
611
614{
615 switch (uMsg)
616 {
617 case WM_INITDIALOG:
618 OnInitSettingsPage(hwndDlg);
619 return TRUE;
620
621 case WM_DESTROY:
622 OnDestroySettingsPage(hwndDlg);
623 break;
624
625 case WM_COMMAND:
627 break;
628
629 case WM_NOTIFY:
630 return OnNotifySettingsPage(hwndDlg, lParam);
631 }
632
633 return FALSE;
634}
INT_PTR CALLBACK AddDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: add_dialog.c:177
HFONT hFont
Definition: main.c:53
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
BOOL g_bRebootNeeded
Definition: input.c:18
INT_PTR CALLBACK KeySettingsDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define IDC_REMOVE_BUTTON
Definition: resource.h:24
#define IDD_ADD
Definition: resource.h:17
#define IDC_KEY_SET_BTN
Definition: resource.h:26
#define IDC_KEYLAYOUT_LIST
Definition: resource.h:21
#define IDI_DOT
Definition: resource.h:10
#define IDI_KEYBOARD
Definition: resource.h:9
#define IDS_KEYBOARD
Definition: resource.h:47
#define IDC_PROP_BUTTON
Definition: resource.h:25
#define IDC_LANGUAGE_BAR
Definition: resource.h:42
#define IDD_INPUT_LANG_PROP
Definition: resource.h:15
#define IDC_ADD_BUTTON
Definition: resource.h:23
#define IDD_KEYSETTINGS
Definition: resource.h:18
#define IDC_DEFAULT_LANGUAGE
Definition: resource.h:22
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
HMODULE hModule
Definition: animate.c:44
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define CloseHandle
Definition: compat.h:739
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
BOOL WINAPI EnumResourceNamesW(HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam)
Definition: res.c:358
INT_PTR CALLBACK EditDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: edit_dialog.c:14
unsigned int BOOL
Definition: ntddk_ex.h:94
pKey DeleteObject()
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
_Out_opt_ PICONINFO IconInfo
Definition: ntuser.h:2294
VOID InputList_SetDefault(INPUT_LIST_NODE *pNode)
Definition: input_list.c:547
BOOL InputList_Process(VOID)
Definition: input_list.c:382
INT InputList_GetAliveCount(VOID)
Definition: input_list.c:783
BOOL InputList_RemoveByLang(LANGID wLangId)
Definition: input_list.c:636
VOID InputList_Destroy(VOID)
Definition: input_list.c:197
INPUT_LIST_NODE * InputList_GetFirst(VOID)
Definition: input_list.c:800
VOID InputList_Create(VOID)
Definition: input_list.c:659
BOOL InputList_Remove(INPUT_LIST_NODE *pNode)
Definition: input_list.c:596
VOID InputList_Sort(VOID)
Definition: input_list.c:724
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
VOID LayoutList_Create(VOID)
Definition: layout_list.c:171
VOID LayoutList_Destroy(VOID)
Definition: layout_list.c:67
USHORT LANGID
Definition: mui.h:9
VOID LocaleList_Destroy(VOID)
Definition: locale_list.c:60
LOCALE_LIST_NODE * LocaleList_Create(VOID)
Definition: locale_list.c:84
LPCWSTR szPath
Definition: env.c:37
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static ATOM item
Definition: dde.c:856
HICON hIcon
Definition: msconfig.c:44
HICON hIconSm
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define UNICODE_NULL
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define RT_GROUP_ICON
Definition: pedump.c:375
#define INT
Definition: polytest.cpp:20
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define TVI_LAST
Definition: commctrl.h:3370
#define TreeView_DeleteAllItems(hwnd)
Definition: commctrl.h:3417
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TreeView_Expand(hwnd, hitem, code)
Definition: commctrl.h:3420
#define TreeView_GetChild(hwnd, hitem)
Definition: commctrl.h:3466
#define NM_TREEVIEW
Definition: commctrl.h:3624
#define ILC_COLOR8
Definition: commctrl.h:355
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define TVIS_BOLD
Definition: commctrl.h:3283
#define TreeView_GetParent(hwnd, hitem)
Definition: commctrl.h:3469
#define TreeView_GetImageList(hwnd, iImage)
Definition: commctrl.h:3441
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3473
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3490
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TV_INSERTSTRUCT
Definition: commctrl.h:3377
#define TVI_ROOT
Definition: commctrl.h:3368
#define TVE_TOGGLE
Definition: commctrl.h:3424
#define TV_ITEM
Definition: commctrl.h:3300
#define TreeView_GetRoot(hwnd)
Definition: commctrl.h:3475
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define TVE_COLLAPSE
Definition: commctrl.h:3422
#define TreeView_GetNextSibling(hwnd, hitem)
Definition: commctrl.h:3467
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define TVN_ITEMEXPANDING
Definition: commctrl.h:3738
#define ILC_MASK
Definition: commctrl.h:351
#define TVIF_PARAM
Definition: commctrl.h:3268
#define TreeView_SetImageList(hwnd, himl, iImage)
Definition: commctrl.h:3447
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3412
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
#define TreeView_SetItem(hwnd, pitem)
Definition: commctrl.h:3497
#define TVIF_STATE
Definition: commctrl.h:3269
#define WM_NOTIFY
Definition: richedit.h:61
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static HICON LoadIMEIcon(LPCTSTR pszImeFile)
static INT_PTR OnNotifySettingsPage(HWND hwndDlg, LPARAM lParam)
static VOID ExpandTreeItem(HWND hwndTree, HTREEITEM hItem)
BOOL EnableProcessPrivileges(LPCWSTR lpPrivilegeName, BOOL bEnable)
static VOID InitDefaultLangComboBox(HWND hwndCombo)
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID AddToInputListView(HWND hwndList, INPUT_LIST_NODE *pInputNode)
static BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
static INT s_iDotImage
Definition: settings_page.c:17
static INT s_nAliveLeafCount
Definition: settings_page.c:14
static VOID OnInitSettingsPage(HWND hwndDlg)
static INT s_iKeyboardImage
Definition: settings_page.c:16
static VOID OnDestroySettingsPage(HWND hwndDlg)
static INT s_nRootCount
Definition: settings_page.c:15
static VOID UpdateInputListView(HWND hwndList)
VOID OnCommandSettingsPage(HWND hwndDlg, WPARAM wParam)
static HICON CreateLayoutIcon(LANGID LangID)
Definition: settings_page.c:20
static HTREEITEM FindLanguageInList(HWND hwndList, LPCTSTR pszLangName)
static VOID SetControlsState(HWND hwndDlg)
#define _countof(array)
Definition: sndvol32.h:68
& rect
Definition: startmenu.cpp:1413
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
LONG lfHeight
Definition: dimm.idl:59
LONG lfWidth
Definition: dimm.idl:60
DWORD yHotspot
Definition: winuser.h:3125
BOOL fIcon
Definition: winuser.h:3123
DWORD xHotspot
Definition: winuser.h:3124
HBITMAP hbmColor
Definition: winuser.h:3127
HBITMAP hbmMask
Definition: winuser.h:3126
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
HTREEITEM hItem
Definition: treelist.h:37
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
COLORREF WINAPI SetDCBrushColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:905
#define ZeroMemory
Definition: winbase.h:1712
#define DONT_RESOLVE_DLL_REFERENCES
Definition: winbase.h:341
_In_ BOOL bEnable
Definition: winddi.h:3426
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define BLACKNESS
Definition: wingdi.h:323
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TRANSPARENT
Definition: wingdi.h:950
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:28
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define CB_SETITEMDATA
Definition: winuser.h:1966
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2581
#define DT_CENTER
Definition: winuser.h:527
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define COLOR_HIGHLIGHT
Definition: winuser.h:926
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1740
#define CB_ERR
Definition: winuser.h:2435
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define CB_SETCURSEL
Definition: winuser.h:1961
#define SM_CYSMICON
Definition: winuser.h:1013
#define CB_RESETCONTENT
Definition: winuser.h:1959
#define WM_INITDIALOG
Definition: winuser.h:1739
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1380
#define CB_GETCOUNT
Definition: winuser.h:1942
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define SM_CXSMICON
Definition: winuser.h:1012
#define CB_ADDSTRING
Definition: winuser.h:1936
struct tagNMHDR * LPNMHDR
#define CB_GETITEMDATA
Definition: winuser.h:1950
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define DT_VCENTER
Definition: winuser.h:543
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define CBN_SELENDOK
Definition: winuser.h:1981
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define CB_GETCURSEL
Definition: winuser.h:1943
#define SetWindowLongPtrW
Definition: winuser.h:5346
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
static int insert
Definition: xmllint.c:138
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185