ReactOS  0.4.13-dev-247-g0f29b3f
key_sequence_dialog.c
Go to the documentation of this file.
1 /*
2 * PROJECT: input.dll
3 * FILE: dll/cpl/input/key_sequence_dialog.c
4 * PURPOSE: input.dll
5 * PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org)
6 */
7 
8 #include "input.h"
9 
10 
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
INT_PTR CALLBACK ChangeKeySeqDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DWORD dwLayout
Definition: input.h:63
#define CALLBACK
Definition: compat.h:27
DWORD dwLanguage
Definition: input.h:62
#define IDC_CTRL_LAYOUT
Definition: resource.h:38
#define IDC_SWITCH_KBLAYOUTS_CB
Definition: resource.h:36
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4698
int32_t INT_PTR
Definition: typedefs.h:62
#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
LONG_PTR LPARAM
Definition: windef.h:208
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
unsigned int UINT
Definition: ndis.h:50
#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