* Ported listbox conrtol from WINE - it doesn't work properly yet, but registers...
[reactos.git] / reactos / lib / user32 / windows / input.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4 *
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.
9 *
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.
14 *
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.
18 */
19 /* $Id: input.c,v 1.13 2003/08/17 22:45:40 silverblade Exp $
20 *
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/windows/input.c
23 * PURPOSE: Input
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
25 * UPDATE HISTORY:
26 * 09-05-2001 CSH Created
27 */
28
29 /* INCLUDES ******************************************************************/
30
31 #include <windows.h>
32 #include <user32.h>
33 #include <debug.h>
34
35 /* FUNCTIONS *****************************************************************/
36
37
38 /*
39 * @unimplemented
40 */
41 WINBOOL
42 STDCALL
43 DragDetect(
44 HWND hWnd,
45 POINT pt)
46 {
47 return NtUserDragDetect(hWnd, pt.x, pt.y);
48 }
49
50
51 /*
52 * @unimplemented
53 */
54 HKL STDCALL
55 ActivateKeyboardLayout(HKL hkl,
56 UINT Flags)
57 {
58 UNIMPLEMENTED;
59 return (HKL)0;
60 }
61
62
63 /*
64 * @unimplemented
65 */
66 WINBOOL STDCALL
67 BlockInput(WINBOOL fBlockIt)
68 {
69 UNIMPLEMENTED;
70 return FALSE;
71 }
72
73
74 /*
75 * @implemented
76 */
77 WINBOOL STDCALL
78 EnableWindow(HWND hWnd,
79 WINBOOL bEnable)
80 {
81 LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
82 Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
83 NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
84
85 SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
86
87 // Return nonzero if it was disabled, or zero if it wasn't:
88 return IsWindowEnabled(hWnd);
89 }
90
91
92 /*
93 * @unimplemented
94 */
95 SHORT STDCALL
96 GetAsyncKeyState(int vKey)
97 {
98 UNIMPLEMENTED;
99 return 0;
100 }
101
102
103 /*
104 * @unimplemented
105 */
106 HKL STDCALL
107 GetKeyboardLayout(DWORD idThread)
108 {
109 UNIMPLEMENTED;
110 return (HKL)0;
111 }
112
113
114 /*
115 * @unimplemented
116 */
117 UINT STDCALL
118 GetKBCodePage(VOID)
119 {
120 UNIMPLEMENTED;
121 return 0;
122 }
123
124
125 /*
126 * @unimplemented
127 */
128 int STDCALL
129 GetKeyNameTextA(LONG lParam,
130 LPSTR lpString,
131 int nSize)
132 {
133 UNIMPLEMENTED;
134 return 0;
135 }
136
137
138 /*
139 * @unimplemented
140 */
141 int STDCALL
142 GetKeyNameTextW(LONG lParam,
143 LPWSTR lpString,
144 int nSize)
145 {
146 UNIMPLEMENTED;
147 return 0;
148 }
149
150
151 /*
152 * @unimplemented
153 */
154 SHORT STDCALL
155 GetKeyState(int nVirtKey)
156 {
157 return (SHORT) NtUserGetKeyState((DWORD) nVirtKey);
158 }
159
160
161 /*
162 * @unimplemented
163 */
164 UINT STDCALL
165 GetKeyboardLayoutList(int nBuff,
166 HKL FAR *lpList)
167 {
168 UNIMPLEMENTED;
169 return 0;
170 }
171
172
173 /*
174 * @unimplemented
175 */
176 WINBOOL STDCALL
177 GetKeyboardLayoutNameA(LPSTR pwszKLID)
178 {
179 UNIMPLEMENTED;
180 return FALSE;
181 }
182
183
184 /*
185 * @unimplemented
186 */
187 WINBOOL STDCALL
188 GetKeyboardLayoutNameW(LPWSTR pwszKLID)
189 {
190 UNIMPLEMENTED;
191 return FALSE;
192 }
193
194
195 /*
196 * @unimplemented
197 */
198 WINBOOL STDCALL
199 GetKeyboardState(PBYTE lpKeyState)
200 {
201
202 return (WINBOOL) NtUserGetKeyboardState((LPBYTE) lpKeyState);
203 }
204
205
206 /*
207 * @unimplemented
208 */
209 int STDCALL
210 GetKeyboardType(int nTypeFlag)
211 {
212 UNIMPLEMENTED;
213 return 0;
214 }
215
216
217 /*
218 * @unimplemented
219 */
220 WINBOOL STDCALL
221 GetLastInputInfo(PLASTINPUTINFO plii)
222 {
223 UNIMPLEMENTED;
224 return FALSE;
225 }
226
227
228 /*
229 * @unimplemented
230 */
231 HKL STDCALL
232 LoadKeyboardLayoutA(LPCSTR pwszKLID,
233 UINT Flags)
234 {
235 UNIMPLEMENTED;
236 return (HKL)0;
237 }
238
239
240 /*
241 * @unimplemented
242 */
243 HKL STDCALL
244 LoadKeyboardLayoutW(LPCWSTR pwszKLID,
245 UINT Flags)
246 {
247 UNIMPLEMENTED;
248 return (HKL)0;
249 }
250
251
252 /*
253 * @unimplemented
254 */
255 UINT STDCALL
256 MapVirtualKeyA(UINT uCode,
257 UINT uMapType)
258 {
259 UNIMPLEMENTED;
260 return 0;
261 }
262
263
264 /*
265 * @unimplemented
266 */
267 UINT STDCALL
268 MapVirtualKeyExA(UINT uCode,
269 UINT uMapType,
270 HKL dwhkl)
271 {
272 UNIMPLEMENTED;
273 return 0;
274 }
275
276
277 /*
278 * @unimplemented
279 */
280 UINT STDCALL
281 MapVirtualKeyExW(UINT uCode,
282 UINT uMapType,
283 HKL dwhkl)
284 {
285 UNIMPLEMENTED;
286 return 0;
287 }
288
289
290 /*
291 * @unimplemented
292 */
293 UINT STDCALL
294 MapVirtualKeyW(UINT uCode,
295 UINT uMapType)
296 {
297 UNIMPLEMENTED;
298 return 0;
299 }
300
301
302 /*
303 * @unimplemented
304 */
305 DWORD STDCALL
306 OemKeyScan(WORD wOemChar)
307 {
308 UNIMPLEMENTED;
309 return 0;
310 }
311
312
313 /*
314 * @unimplemented
315 */
316 HWND STDCALL
317 SetFocus(HWND hWnd)
318 {
319 return NtUserSetFocus(hWnd);
320 }
321
322
323 /*
324 * @unimplemented
325 */
326 WINBOOL STDCALL
327 SetKeyboardState(LPBYTE lpKeyState)
328 {
329 return (WINBOOL) NtUserSetKeyboardState((LPBYTE)lpKeyState);
330 }
331
332
333 /*
334 * @unimplemented
335 */
336 int STDCALL
337 ToAscii(UINT uVirtKey,
338 UINT uScanCode,
339 CONST PBYTE lpKeyState,
340 LPWORD lpChar,
341 UINT uFlags)
342 {
343 UNIMPLEMENTED;
344 return 0;
345 }
346
347
348 /*
349 * @unimplemented
350 */
351 int STDCALL
352 ToAsciiEx(UINT uVirtKey,
353 UINT uScanCode,
354 CONST PBYTE lpKeyState,
355 LPWORD lpChar,
356 UINT uFlags,
357 HKL dwhkl)
358 {
359 UNIMPLEMENTED;
360 return 0;
361 }
362
363
364 /*
365 * @unimplemented
366 */
367 int STDCALL
368 ToUnicode(UINT wVirtKey,
369 UINT wScanCode,
370 CONST PBYTE lpKeyState,
371 LPWSTR pwszBuff,
372 int cchBuff,
373 UINT wFlags)
374 {
375 UNIMPLEMENTED;
376 return 0;
377 }
378
379
380 /*
381 * @unimplemented
382 */
383 int STDCALL
384 ToUnicodeEx(UINT wVirtKey,
385 UINT wScanCode,
386 CONST PBYTE lpKeyState,
387 LPWSTR pwszBuff,
388 int cchBuff,
389 UINT wFlags,
390 HKL dwhkl)
391 {
392 UNIMPLEMENTED;
393 return 0;
394 }
395
396
397 /*
398 * @unimplemented
399 */
400 WINBOOL STDCALL
401 UnloadKeyboardLayout(HKL hkl)
402 {
403 UNIMPLEMENTED;
404 return FALSE;
405 }
406
407
408 /*
409 * @unimplemented
410 */
411 SHORT STDCALL
412 VkKeyScanA(CHAR ch)
413 {
414 UNIMPLEMENTED;
415 return 0;
416 }
417
418
419 /*
420 * @unimplemented
421 */
422 SHORT STDCALL
423 VkKeyScanExA(CHAR ch,
424 HKL dwhkl)
425 {
426 UNIMPLEMENTED;
427 return 0;
428 }
429
430
431 /*
432 * @unimplemented
433 */
434 SHORT STDCALL
435 VkKeyScanExW(WCHAR ch,
436 HKL dwhkl)
437 {
438 UNIMPLEMENTED;
439 return 0;
440 }
441
442
443 /*
444 * @unimplemented
445 */
446 SHORT STDCALL
447 VkKeyScanW(WCHAR ch)
448 {
449 UNIMPLEMENTED;
450 return 0;
451 }
452
453
454 /*
455 * @unimplemented
456 */
457 UINT
458 STDCALL
459 SendInput(
460 UINT nInputs,
461 LPINPUT pInputs,
462 int cbSize)
463 {
464 UNIMPLEMENTED;
465 return 0;
466 }