ReactOS  0.4.13-dev-551-gf37fb1f
input.h File Reference
#include <stdlib.h>
#include <wchar.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <winuser.h>
#include <wingdi.h>
#include <commctrl.h>
#include <windowsx.h>
#include <setupapi.h>
#include <strsafe.h>
#include "resource.h"
Include dependency graph for input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  APPLET
 
struct  KEY_SETTINGS
 

Macros

#define WIN32_NO_STATUS
 
#define CCH_LAYOUT_ID   8
 
#define CCH_ULONG_DEC   10
 
#define MAX_STR_LEN   256
 

Typedefs

typedef LONG(CALLBACKCPLAPPLET_PROC) (VOID)
 
typedef struct APPLETPAPPLET
 

Functions

INT_PTR CALLBACK SettingsPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AdvancedSettingsPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AddDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK EditDialogProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK KeySettingsDialogProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
DWORD ReadAttributes (VOID)
 
INT_PTR CALLBACK ChangeKeySeqDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD DWORDfromString (const WCHAR *pszString)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ CCH_LAYOUT_ID

#define CCH_LAYOUT_ID   8

Definition at line 34 of file input.h.

◆ CCH_ULONG_DEC

#define CCH_ULONG_DEC   10

Definition at line 37 of file input.h.

◆ MAX_STR_LEN

#define MAX_STR_LEN   256

Definition at line 39 of file input.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 7 of file input.h.

Typedef Documentation

◆ CPLAPPLET_PROC

typedef LONG(CALLBACK * CPLAPPLET_PROC) (VOID)

Definition at line 21 of file input.h.

◆ PAPPLET

typedef struct APPLET * PAPPLET

Function Documentation

◆ AddDialogProc()

INT_PTR CALLBACK AddDialogProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 177 of file add_dialog.c.

178 {
179  switch (uMsg)
180  {
181  case WM_INITDIALOG:
182  OnInitAddDialog(hwndDlg);
183  break;
184 
185  case WM_COMMAND:
186  OnCommandAddDialog(hwndDlg, wParam);
187  break;
188 
189  case WM_DESTROY:
190  break;
191  }
192 
193  return FALSE;
194 }
WPARAM wParam
Definition: combotst.c:138
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnCommandAddDialog(HWND hwndDlg, WPARAM wParam)
Definition: add_dialog.c:108
static VOID OnInitAddDialog(HWND hwndDlg)
Definition: add_dialog.c:62
#define WM_INITDIALOG
Definition: winuser.h:1715

Referenced by OnCommandSettingsPage().

◆ AdvancedSettingsPageProc()

INT_PTR CALLBACK AdvancedSettingsPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 12 of file advanced_settings_page.c.

13 {
14  return FALSE;
15 }

Referenced by SystemApplet().

◆ ChangeKeySeqDialogProc()

INT_PTR CALLBACK ChangeKeySeqDialogProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 12 of file key_sequence_dialog.c.

13 {
15 
16  switch (uMsg)
17  {
18  case WM_INITDIALOG:
19  {
20  KEY_SETTINGS *keySettings = (KEY_SETTINGS*) lParam;
21 
22  if (keySettings != NULL)
23  {
24  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR) keySettings);
25 
26  if (keySettings->dwLanguage == 3)
27  {
31  }
32  else
33  {
35 
36  if (keySettings->dwLanguage == 1)
37  {
39  }
40  else
41  {
43  }
44  }
45 
46  if (keySettings->dwLayout == 3)
47  {
51  }
52  else
53  {
55 
56  if (keySettings->dwLayout == 1)
57  {
59  }
60  else
61  {
63  }
64  }
65  }
66  }
67  break;
68 
69  case WM_COMMAND:
70  {
71  switch (LOWORD(wParam))
72  {
74  {
75  if (HIWORD(wParam) == BN_CLICKED)
76  {
78  {
81  }
82  else
83  {
86  }
87  }
88  }
89  break;
90 
92  {
93  if (HIWORD(wParam) == BN_CLICKED)
94  {
96  {
99  }
100  else
101  {
104  }
105  }
106  }
107  break;
108 
109  case IDC_CTRL_LANG:
110  {
111  if (HIWORD(wParam) == BN_CLICKED)
112  {
115  }
116  }
117  break;
118 
119  case IDC_LEFT_ALT_LANG:
120  {
121  if (HIWORD(wParam) == BN_CLICKED)
122  {
125  }
126  }
127  break;
128 
129  case IDC_CTRL_LAYOUT:
130  {
131  if (HIWORD(wParam) == BN_CLICKED)
132  {
135  }
136  }
137  break;
138 
139  case IDC_LEFT_ALT_LAYOUT:
140  {
141  if (HIWORD(wParam) == BN_CLICKED)
142  {
145  }
146  }
147  break;
148 
149  case IDOK:
150  {
151  KEY_SETTINGS *keySettings;
152 
153  keySettings = (KEY_SETTINGS*)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
154 
155  if (keySettings != NULL)
156  {
158  {
160  {
161  keySettings->dwLanguage = 2;
162  }
163  else
164  {
165  keySettings->dwLanguage = 1;
166  }
167  }
168  else
169  {
170  keySettings->dwLanguage = 3;
171  }
172 
174  {
176  {
177  keySettings->dwLayout = 2;
178  }
179  else
180  {
181  keySettings->dwLayout = 1;
182  }
183  }
184  else
185  {
186  keySettings->dwLayout = 3;
187  }
188  }
189 
190  EndDialog(hwndDlg, LOWORD(wParam));
191  }
192  break;
193 
194  case IDCANCEL:
195  {
196  EndDialog(hwndDlg, LOWORD(wParam));
197  }
198  break;
199  }
200  }
201  break;
202  }
203 
204  return FALSE;
205 }
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_LEFT_ALT_LANG
Definition: resource.h:39
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
DWORD dwLayout
Definition: input.h:63
DWORD dwLanguage
Definition: input.h:62
#define IDC_CTRL_LAYOUT
Definition: resource.h:38
#define IDC_SWITCH_KBLAYOUTS_CB
Definition: resource.h:36
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define IDC_CTRL_LANG
Definition: resource.h:37
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_SWITCH_INPUT_LANG_CB
Definition: resource.h:35
#define BN_CLICKED
Definition: winuser.h:1886
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define BST_CHECKED
Definition: winuser.h:197
#define HIWORD(l)
Definition: typedefs.h:246
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define IDCANCEL
Definition: winuser.h:825
#define IDC_LEFT_ALT_LAYOUT
Definition: resource.h:40
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by KeySettingsDialogProc().

◆ DWORDfromString()

static DWORD DWORDfromString ( const WCHAR pszString)
inlinestatic

Definition at line 78 of file input.h.

79 {
80  WCHAR *pszEnd;
81 
82  return wcstoul(pszString, &pszEnd, 16);
83 }
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4509

Referenced by GetDefaultLayoutForLocale(), LayoutList_Create(), and LocaleList_Create().

◆ EditDialogProc()

INT_PTR CALLBACK EditDialogProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 14 of file edit_dialog.c.

15 {
17 
18  switch (uMsg)
19  {
20  case WM_INITDIALOG:
21  {
22  LAYOUT_LIST_NODE *pCurrentLayout;
23  INPUT_LIST_NODE *pInput;
24  HWND hwndList;
25 
26  pInput = (INPUT_LIST_NODE*) lParam;
27 
28  if (pInput == NULL)
29  return TRUE;
30 
31  SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR) pInput);
32 
34 
35  hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
36 
37  for (pCurrentLayout = LayoutList_GetFirst();
38  pCurrentLayout != NULL;
39  pCurrentLayout = pCurrentLayout->pNext)
40  {
41  INT iItemIndex;
42 
43  iItemIndex = ComboBox_AddString(hwndList, pCurrentLayout->pszName);
44  ComboBox_SetItemData(hwndList, iItemIndex, pCurrentLayout);
45  }
46 
47  ComboBox_SelectString(hwndList, 0, pInput->pLayout->pszName);
48  }
49  break;
50 
51  case WM_COMMAND:
52  {
53  switch (LOWORD(wParam))
54  {
55  case IDOK:
56  {
57  INPUT_LIST_NODE *pInput;
58  HWND hwndList;
59 
60  hwndList = GetDlgItem(hwndDlg, IDC_KB_LAYOUT_IME_COMBO);
61 
62  pInput = (INPUT_LIST_NODE*) GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
63 
64  if (pInput != NULL)
65  {
66  LAYOUT_LIST_NODE *pNewLayout;
67 
68  pNewLayout = (LAYOUT_LIST_NODE*)ComboBox_GetItemData(hwndList,
69  ComboBox_GetCurSel(hwndList));
70  if (pNewLayout != NULL)
71  {
72  pInput->pLayout = pNewLayout;
74  }
75  }
76 
77  EndDialog(hwndDlg, LOWORD(wParam));
78  }
79  break;
80 
81  case IDCANCEL:
82  {
83  EndDialog(hwndDlg, LOWORD(wParam));
84  }
85  break;
86  }
87  }
88  break;
89  }
90 
91  return FALSE;
92 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:18
LAYOUT_LIST_NODE * LayoutList_GetFirst(VOID)
Definition: layout_list.c:274
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:24
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetWindowLongPtrW
Definition: winuser.h:4698
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:19
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
struct _LAYOUT_LIST_NODE * pNext
Definition: layout_list.h:13
#define IDC_INPUT_LANG_STR
Definition: resource.h:34
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:29
#define ComboBox_SelectString(hwndCtl, indexStart, lpszSelect)
Definition: windowsx.h:40
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_KB_LAYOUT_IME_COMBO
Definition: resource.h:33
#define ComboBox_SetItemData(hwndCtl, index, data)
Definition: windowsx.h:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define INPUT_LIST_NODE_FLAG_EDITED
Definition: input_list.h:8

Referenced by OnCommandSettingsPage().

◆ KeySettingsDialogProc()

INT_PTR CALLBACK KeySettingsDialogProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 224 of file key_settings_dialog.c.

225 {
227 
228  switch (uMsg)
229  {
230  case WM_INITDIALOG:
231  {
232  OnInitKeySettingsDialog(hwndDlg);
233  }
234  break;
235 
236  case WM_COMMAND:
237  {
238  switch (LOWORD(wParam))
239  {
241  {
244  hwndDlg,
246  (LPARAM)&_KeySettings) == IDOK)
247  {
249  }
250  }
251  break;
252 
253  case IDOK:
254  {
256  {
257  _KeySettings.dwAttributes &= ~KLF_SHIFTLOCK;
258  }
259  else
260  {
261  _KeySettings.dwAttributes |= KLF_SHIFTLOCK;
262  }
263 
265  EndDialog(hwndDlg, LOWORD(wParam));
266  }
267  break;
268 
269  case IDCANCEL:
270  {
271  EndDialog(hwndDlg, LOWORD(wParam));
272  }
273  break;
274  }
275  }
276  break;
277  }
278 
279  return FALSE;
280 }
#define IDOK
Definition: winuser.h:824
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
static VOID UpdateKeySettingsListView(HWND hwndList)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define IDC_CHANGE_KEY_SEQ_BTN
Definition: resource.h:29
HINSTANCE hApplet
Definition: access.c:17
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDD_CHANGE_KEY_SEQ
Definition: resource.h:15
#define IDC_KEY_LISTVIEW
Definition: resource.h:28
#define IDC_PRESS_CL_KEY_RB
Definition: resource.h:26
LONG_PTR LPARAM
Definition: windef.h:208
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
INT_PTR CALLBACK ChangeKeySeqDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnInitKeySettingsDialog(HWND hwndDlg)
#define BST_CHECKED
Definition: winuser.h:197
DWORD dwAttributes
Definition: input.h:61
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static KEY_SETTINGS _KeySettings
static VOID WriteKeysSettings(VOID)

Referenced by OnCommandSettingsPage().

◆ ReadAttributes()

DWORD ReadAttributes ( VOID  )

Definition at line 14 of file key_settings_dialog.c.

15 {
16  DWORD dwAttributes = 0;
17  HKEY hKey;
18 
20  L"Keyboard Layout",
21  0,
23  &hKey) == ERROR_SUCCESS)
24  {
25  DWORD dwSize = sizeof(dwAttributes);
26 
27  RegQueryValueExW(hKey,
28  L"Attributes",
29  NULL, NULL,
31  &dwSize);
32 
33  RegCloseKey(hKey);
34  }
35 
36  return dwAttributes;
37 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
DWORD dwAttributes
Definition: vdmdbg.h:34
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by ReadKeysSettings().

◆ SettingsPageProc()

INT_PTR CALLBACK SettingsPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 448 of file settings_page.c.

449 {
450  switch (uMsg)
451  {
452  case WM_INITDIALOG:
453  OnInitSettingsPage(hwndDlg);
454  break;
455 
456  case WM_DESTROY:
457  OnDestroySettingsPage(hwndDlg);
458  break;
459 
460  case WM_COMMAND:
461  OnCommandSettingsPage(hwndDlg, wParam);
462  break;
463 
464  case WM_NOTIFY:
465  OnNotifySettingsPage(hwndDlg, lParam);
466  break;
467  }
468 
469  return FALSE;
470 }
VOID OnCommandSettingsPage(HWND hwndDlg, WPARAM wParam)
WPARAM wParam
Definition: combotst.c:138
#define WM_DESTROY
Definition: winuser.h:1591
static VOID OnNotifySettingsPage(HWND hwndDlg, LPARAM lParam)
static VOID OnDestroySettingsPage(HWND hwndDlg)
#define WM_COMMAND
Definition: winuser.h:1716
static VOID OnInitSettingsPage(HWND hwndDlg)
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Variable Documentation

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.