wined3d: Introduce the "glsl-vkd3d" shader backend.
[wine.git] / dlls / user32 / input.c
blob00337aa72b7109e6332a3cead14b83ef65473a52
1 /*
2 * USER Input processing
4 * Copyright 1993 Bob Amstadt
5 * Copyright 1996 Albrecht Kleine
6 * Copyright 1997 David Faure
7 * Copyright 1998 Morten Welinder
8 * Copyright 1998 Ulrich Weigand
9 * Copyright 2012 Henri Verbeet
10 * Copyright 2018 Zebediah Figura for CodeWeavers
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "user_private.h"
28 #include "dbt.h"
29 #include "wine/server.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(win);
33 WINE_DECLARE_DEBUG_CHANNEL(keyboard);
35 /***********************************************************************
36 * get_locale_kbd_layout
38 static HKL get_locale_kbd_layout(void)
40 ULONG_PTR layout;
42 /* FIXME:
44 * layout = main_key_tab[kbd_layout].lcid;
46 * Winword uses return value of GetKeyboardLayout as a codepage
47 * to translate ANSI keyboard messages to unicode. But we have
48 * a problem with it: for instance Polish keyboard layout is
49 * identical to the US one, and therefore instead of the Polish
50 * locale id we return the US one.
53 layout = GetUserDefaultLCID();
54 layout = MAKELONG( layout, layout );
55 return (HKL)layout;
59 /***********************************************************************
60 * keybd_event (USER32.@)
62 void WINAPI keybd_event( BYTE bVk, BYTE bScan,
63 DWORD dwFlags, ULONG_PTR dwExtraInfo )
65 INPUT input;
67 input.type = INPUT_KEYBOARD;
68 input.ki.wVk = bVk;
69 input.ki.wScan = bScan;
70 input.ki.dwFlags = dwFlags;
71 input.ki.time = 0;
72 input.ki.dwExtraInfo = dwExtraInfo;
73 NtUserSendInput( 1, &input, sizeof(input) );
77 /***********************************************************************
78 * mouse_event (USER32.@)
80 void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
81 DWORD dwData, ULONG_PTR dwExtraInfo )
83 INPUT input;
85 input.type = INPUT_MOUSE;
86 input.mi.dx = dx;
87 input.mi.dy = dy;
88 input.mi.mouseData = dwData;
89 input.mi.dwFlags = dwFlags;
90 input.mi.time = 0;
91 input.mi.dwExtraInfo = dwExtraInfo;
92 NtUserSendInput( 1, &input, sizeof(input) );
96 /***********************************************************************
97 * GetCursorPos (USER32.@)
99 BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
101 return NtUserGetCursorPos( pt );
105 /**********************************************************************
106 * ReleaseCapture (USER32.@)
108 BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture(void)
110 return NtUserReleaseCapture();
114 /**********************************************************************
115 * GetCapture (USER32.@)
117 HWND WINAPI GetCapture(void)
119 GUITHREADINFO info;
120 info.cbSize = sizeof(info);
121 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndCapture : 0;
125 /*****************************************************************
126 * DestroyCaret (USER32.@)
128 BOOL WINAPI DestroyCaret(void)
130 return NtUserDestroyCaret();
134 /*****************************************************************
135 * SetCaretPos (USER32.@)
137 BOOL WINAPI SetCaretPos( int x, int y )
139 return NtUserSetCaretPos( x, y );
143 /*****************************************************************
144 * SetCaretBlinkTime (USER32.@)
146 BOOL WINAPI SetCaretBlinkTime( unsigned int time )
148 return NtUserSetCaretBlinkTime( time );
152 /***********************************************************************
153 * GetInputState (USER32.@)
155 BOOL WINAPI GetInputState(void)
157 return NtUserGetInputState();
161 /******************************************************************
162 * GetLastInputInfo (USER32.@)
164 BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii)
166 BOOL ret;
168 TRACE("%p\n", plii);
170 if (plii->cbSize != sizeof (*plii) )
172 SetLastError(ERROR_INVALID_PARAMETER);
173 return FALSE;
176 SERVER_START_REQ( get_last_input_time )
178 ret = !wine_server_call_err( req );
179 if (ret)
180 plii->dwTime = reply->time;
182 SERVER_END_REQ;
183 return ret;
187 /**********************************************************************
188 * VkKeyScanA (USER32.@)
190 * VkKeyScan translates an ANSI character to a virtual-key and shift code
191 * for the current keyboard.
192 * high-order byte yields :
193 * 0 Unshifted
194 * 1 Shift
195 * 2 Ctrl
196 * 3-5 Shift-key combinations that are not used for characters
197 * 6 Ctrl-Alt
198 * 7 Ctrl-Alt-Shift
199 * I.e. : Shift = 1, Ctrl = 2, Alt = 4.
200 * FIXME : works ok except for dead chars :
201 * VkKeyScan '^'(0x5e, 94) ... got keycode 00 ... returning 00
202 * VkKeyScan '`'(0x60, 96) ... got keycode 00 ... returning 00
204 SHORT WINAPI VkKeyScanA(CHAR cChar)
206 WCHAR wChar;
208 if (IsDBCSLeadByte(cChar)) return -1;
210 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
211 return VkKeyScanW(wChar);
214 /******************************************************************************
215 * VkKeyScanW (USER32.@)
217 SHORT WINAPI VkKeyScanW(WCHAR cChar)
219 return NtUserVkKeyScanEx( cChar, NtUserGetKeyboardLayout(0) );
222 /**********************************************************************
223 * VkKeyScanExA (USER32.@)
225 WORD WINAPI VkKeyScanExA(CHAR cChar, HKL dwhkl)
227 WCHAR wChar;
229 if (IsDBCSLeadByte(cChar)) return -1;
231 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
232 return NtUserVkKeyScanEx( wChar, dwhkl );
235 /**********************************************************************
236 * OemKeyScan (USER32.@)
238 DWORD WINAPI OemKeyScan( WORD oem )
240 WCHAR wchr;
241 DWORD vkey, scan;
242 char oem_char = LOBYTE( oem );
244 if (!OemToCharBuffW( &oem_char, &wchr, 1 ))
245 return -1;
247 vkey = VkKeyScanW( wchr );
248 scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
249 if (!scan) return -1;
251 vkey &= 0xff00;
252 vkey <<= 8;
253 return vkey | scan;
256 /******************************************************************************
257 * GetKeyboardType (USER32.@)
259 INT WINAPI GetKeyboardType(INT nTypeFlag)
261 TRACE_(keyboard)("(%d)\n", nTypeFlag);
262 if (LOWORD(NtUserGetKeyboardLayout(0)) == MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN))
264 /* scan code for `_', the key left of r-shift, in Japanese 106 keyboard */
265 const UINT JP106_VSC_USCORE = 0x73;
267 switch(nTypeFlag)
269 case 0: /* Keyboard type */
270 return 7; /* Japanese keyboard */
271 case 1: /* Keyboard Subtype */
272 /* Test keyboard mappings to detect Japanese keyboard */
273 if (MapVirtualKeyW(VK_OEM_102, MAPVK_VK_TO_VSC) == JP106_VSC_USCORE
274 && MapVirtualKeyW(JP106_VSC_USCORE, MAPVK_VSC_TO_VK) == VK_OEM_102)
275 return 2; /* Japanese 106 */
276 else
277 return 0; /* AT-101 */
278 case 2: /* Number of F-keys */
279 return 12; /* It has 12 F-keys */
282 else
284 switch(nTypeFlag)
286 case 0: /* Keyboard type */
287 return 4; /* AT-101 */
288 case 1: /* Keyboard Subtype */
289 return 0; /* There are no defined subtypes */
290 case 2: /* Number of F-keys */
291 return 12; /* We're doing an 101 for now, so return 12 F-keys */
294 WARN_(keyboard)("Unknown type\n");
295 return 0; /* The book says 0 here, so 0 */
298 /******************************************************************************
299 * MapVirtualKeyA (USER32.@)
301 UINT WINAPI MapVirtualKeyA(UINT code, UINT maptype)
303 return MapVirtualKeyExA( code, maptype, NtUserGetKeyboardLayout(0) );
306 /******************************************************************************
307 * MapVirtualKeyW (USER32.@)
309 UINT WINAPI MapVirtualKeyW(UINT code, UINT maptype)
311 return NtUserMapVirtualKeyEx( code, maptype, NtUserGetKeyboardLayout(0) );
314 /******************************************************************************
315 * MapVirtualKeyExA (USER32.@)
317 UINT WINAPI MapVirtualKeyExA(UINT code, UINT maptype, HKL hkl)
319 UINT ret;
321 ret = NtUserMapVirtualKeyEx( code, maptype, hkl );
322 if (maptype == MAPVK_VK_TO_CHAR)
324 BYTE ch = 0;
325 WCHAR wch = ret;
327 WideCharToMultiByte( CP_ACP, 0, &wch, 1, (LPSTR)&ch, 1, NULL, NULL );
328 ret = ch;
330 return ret;
333 /****************************************************************************
334 * GetKBCodePage (USER32.@)
336 UINT WINAPI GetKBCodePage(void)
338 return GetOEMCP();
341 /****************************************************************************
342 * GetKeyboardLayoutNameA (USER32.@)
344 BOOL WINAPI GetKeyboardLayoutNameA(LPSTR pszKLID)
346 WCHAR buf[KL_NAMELENGTH];
348 if (NtUserGetKeyboardLayoutName( buf ))
349 return WideCharToMultiByte( CP_ACP, 0, buf, -1, pszKLID, KL_NAMELENGTH, NULL, NULL ) != 0;
350 return FALSE;
353 /****************************************************************************
354 * GetKeyNameTextA (USER32.@)
356 INT WINAPI GetKeyNameTextA(LONG lParam, LPSTR lpBuffer, INT nSize)
358 WCHAR buf[256];
359 INT ret;
361 if (!nSize || !NtUserGetKeyNameText( lParam, buf, ARRAYSIZE(buf) ))
363 lpBuffer[0] = 0;
364 return 0;
366 ret = WideCharToMultiByte(CP_ACP, 0, buf, -1, lpBuffer, nSize, NULL, NULL);
367 if (!ret && nSize)
369 ret = nSize - 1;
370 lpBuffer[ret] = 0;
372 else ret--;
374 return ret;
377 /****************************************************************************
378 * ToUnicode (USER32.@)
380 INT WINAPI ToUnicode( UINT virt, UINT scan, const BYTE *state, LPWSTR str, int size, UINT flags )
382 return NtUserToUnicodeEx( virt, scan, state, str, size, flags, NtUserGetKeyboardLayout(0) );
385 /****************************************************************************
386 * ToAscii (USER32.@)
388 INT WINAPI ToAscii( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
389 LPWORD lpChar, UINT flags )
391 return ToAsciiEx( virtKey, scanCode, lpKeyState, lpChar, flags,
392 NtUserGetKeyboardLayout(0) );
395 /****************************************************************************
396 * ToAsciiEx (USER32.@)
398 INT WINAPI ToAsciiEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
399 LPWORD lpChar, UINT flags, HKL dwhkl )
401 WCHAR uni_chars[2];
402 INT ret, n_ret;
404 ret = NtUserToUnicodeEx( virtKey, scanCode, lpKeyState, uni_chars, 2, flags, dwhkl );
405 if (ret < 0) n_ret = 1; /* FIXME: make ToUnicode return 2 for dead chars */
406 else n_ret = ret;
407 WideCharToMultiByte(CP_ACP, 0, uni_chars, n_ret, (LPSTR)lpChar, 2, NULL, NULL);
408 return ret;
411 /**********************************************************************
412 * BlockInput (USER32.@)
414 BOOL WINAPI BlockInput(BOOL fBlockIt)
416 FIXME_(keyboard)("(%d): stub\n", fBlockIt);
417 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
419 return FALSE;
423 /***********************************************************************
424 * LoadKeyboardLayoutW (USER32.@)
426 HKL WINAPI LoadKeyboardLayoutW( const WCHAR *name, UINT flags )
428 WCHAR layout_path[MAX_PATH], value[5];
429 LCID locale = GetUserDefaultLCID();
430 DWORD id, value_size, tmp;
431 HKEY hkey;
432 HKL layout;
434 FIXME_(keyboard)( "name %s, flags %x, semi-stub!\n", debugstr_w( name ), flags );
436 tmp = wcstoul( name, NULL, 16 );
437 if (HIWORD( tmp )) layout = UlongToHandle( tmp );
438 else layout = UlongToHandle( MAKELONG( LOWORD( tmp ), LOWORD( tmp ) ) );
440 if (!((UINT_PTR)layout >> 28)) id = LOWORD( tmp );
441 else id = HIWORD( layout ); /* IME or aliased layout */
443 wcscpy( layout_path, L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\" );
444 wcscat( layout_path, name );
446 if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, layout_path, &hkey ))
448 value_size = sizeof(value);
449 if (!RegGetValueW( hkey, NULL, L"Layout Id", RRF_RT_REG_SZ, NULL, (void *)&value, &value_size ))
450 id = 0xf000 | (wcstoul( value, NULL, 16 ) & 0xfff);
452 RegCloseKey( hkey );
455 layout = UlongToHandle( MAKELONG( locale, id ) );
456 if ((flags & KLF_ACTIVATE) && NtUserActivateKeyboardLayout( layout, 0 )) return layout;
458 /* FIXME: semi-stub: returning default layout */
459 return get_locale_kbd_layout();
462 /***********************************************************************
463 * LoadKeyboardLayoutA (USER32.@)
465 HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags)
467 HKL ret;
468 UNICODE_STRING pwszKLIDW;
470 if (pwszKLID) RtlCreateUnicodeStringFromAsciiz(&pwszKLIDW, pwszKLID);
471 else pwszKLIDW.Buffer = NULL;
473 ret = LoadKeyboardLayoutW(pwszKLIDW.Buffer, Flags);
474 RtlFreeUnicodeString(&pwszKLIDW);
475 return ret;
479 /***********************************************************************
480 * LoadKeyboardLayoutEx (USER32.@)
482 HKL WINAPI LoadKeyboardLayoutEx( HKL layout, const WCHAR *name, UINT flags )
484 FIXME_(keyboard)( "layout %p, name %s, flags %x, semi-stub!\n", layout, debugstr_w( name ), flags );
486 if (!layout) return NULL;
487 return LoadKeyboardLayoutW( name, flags );
490 /***********************************************************************
491 * UnloadKeyboardLayout (USER32.@)
493 BOOL WINAPI UnloadKeyboardLayout( HKL layout )
495 FIXME_(keyboard)( "layout %p, stub!\n", layout );
496 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
497 return FALSE;
501 static DWORD CALLBACK devnotify_window_callbackW(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
503 SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
504 return 0;
507 static DWORD CALLBACK devnotify_window_callbackA(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
509 if (flags & 0x8000)
511 switch (header->dbch_devicetype)
513 case DBT_DEVTYP_DEVICEINTERFACE:
515 const DEV_BROADCAST_DEVICEINTERFACE_W *ifaceW = (const DEV_BROADCAST_DEVICEINTERFACE_W *)header;
516 size_t lenW = wcslen( ifaceW->dbcc_name );
517 DEV_BROADCAST_DEVICEINTERFACE_A *ifaceA;
518 DWORD lenA;
520 if (!(ifaceA = malloc( offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenW * 3 + 1]) )))
521 return 0;
522 lenA = WideCharToMultiByte( CP_ACP, 0, ifaceW->dbcc_name, lenW + 1,
523 ifaceA->dbcc_name, lenW * 3 + 1, NULL, NULL );
525 ifaceA->dbcc_size = offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenA + 1]);
526 ifaceA->dbcc_devicetype = ifaceW->dbcc_devicetype;
527 ifaceA->dbcc_reserved = ifaceW->dbcc_reserved;
528 ifaceA->dbcc_classguid = ifaceW->dbcc_classguid;
529 SendMessageTimeoutA( handle, WM_DEVICECHANGE, flags, (LPARAM)ifaceA, SMTO_ABORTIFHUNG, 2000, NULL );
530 free( ifaceA );
531 return 0;
534 default:
535 FIXME( "unimplemented W to A mapping for %#lx\n", header->dbch_devicetype );
536 /* fall through */
537 case DBT_DEVTYP_HANDLE:
538 case DBT_DEVTYP_OEM:
539 break;
543 SendMessageTimeoutA( handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL );
544 return 0;
547 static DWORD CALLBACK devnotify_service_callback(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
549 FIXME("Support for service handles is not yet implemented!\n");
550 return 0;
553 struct device_notification_details
555 DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header);
556 HANDLE handle;
557 union
559 DEV_BROADCAST_HDR header;
560 DEV_BROADCAST_DEVICEINTERFACE_W iface;
561 } filter;
564 extern HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_details *details,
565 void *filter, DWORD flags );
566 extern BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle );
568 /***********************************************************************
569 * RegisterDeviceNotificationA (USER32.@)
571 * See RegisterDeviceNotificationW.
573 HDEVNOTIFY WINAPI RegisterDeviceNotificationA( HANDLE handle, void *filter, DWORD flags )
575 return RegisterDeviceNotificationW( handle, filter, flags );
578 /***********************************************************************
579 * RegisterDeviceNotificationW (USER32.@)
581 HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWORD flags )
583 struct device_notification_details details;
584 DEV_BROADCAST_HDR *header = filter;
586 TRACE("handle %p, filter %p, flags %#lx\n", handle, filter, flags);
588 if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES))
590 SetLastError( ERROR_INVALID_PARAMETER );
591 return NULL;
594 if (!(flags & DEVICE_NOTIFY_SERVICE_HANDLE) && !IsWindow( handle ))
596 SetLastError( ERROR_INVALID_PARAMETER );
597 return NULL;
600 if (!header) details.filter.header.dbch_devicetype = 0;
601 else if (header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
603 DEV_BROADCAST_DEVICEINTERFACE_W *iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)header;
604 details.filter.iface = *iface;
606 if (flags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
607 details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_classguid );
608 else
609 details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name );
611 else if (header->dbch_devicetype == DBT_DEVTYP_HANDLE)
613 FIXME( "DBT_DEVTYP_HANDLE filter type not implemented\n" );
614 details.filter.header.dbch_devicetype = 0;
616 else
618 SetLastError( ERROR_INVALID_DATA );
619 return NULL;
622 details.handle = handle;
624 if (flags & DEVICE_NOTIFY_SERVICE_HANDLE)
625 details.cb = devnotify_service_callback;
626 else if (IsWindowUnicode( handle ))
627 details.cb = devnotify_window_callbackW;
628 else
629 details.cb = devnotify_window_callbackA;
631 return I_ScRegisterDeviceNotification( &details, filter, 0 );
634 /***********************************************************************
635 * UnregisterDeviceNotification (USER32.@)
637 BOOL WINAPI UnregisterDeviceNotification( HDEVNOTIFY handle )
639 TRACE("%p\n", handle);
641 return I_ScUnregisterDeviceNotification( handle );
644 /***********************************************************************
645 * GetRawInputDeviceInfoA (USER32.@)
647 UINT WINAPI GetRawInputDeviceInfoA( HANDLE device, UINT command, void *data, UINT *size )
649 TRACE( "device %p, command %#x, data %p, size %p.\n", device, command, data, size );
651 /* RIDI_DEVICENAME size is in chars, not bytes */
652 if (command == RIDI_DEVICENAME)
654 WCHAR *nameW;
655 UINT ret, sizeW;
657 if (!size) return ~0U;
659 sizeW = *size;
661 if (data && sizeW > 0)
662 nameW = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * sizeW );
663 else
664 nameW = NULL;
666 ret = NtUserGetRawInputDeviceInfo( device, command, nameW, &sizeW );
668 if (ret && ret != ~0U)
669 WideCharToMultiByte( CP_ACP, 0, nameW, -1, data, *size, NULL, NULL );
671 *size = sizeW;
673 HeapFree( GetProcessHeap(), 0, nameW );
675 return ret;
678 return NtUserGetRawInputDeviceInfo( device, command, data, size );
681 /***********************************************************************
682 * DefRawInputProc (USER32.@)
684 LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_size )
686 TRACE( "data %p, data_count %d, header_size %u.\n", data, data_count, header_size );
688 return header_size == sizeof(RAWINPUTHEADER) ? 0 : -1;
691 /*****************************************************************************
692 * CloseTouchInputHandle (USER32.@)
694 BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle )
696 FIXME( "handle %p stub!\n", handle );
697 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
698 return FALSE;
701 /*****************************************************************************
702 * GetTouchInputInfo (USER32.@)
704 BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size )
706 FIXME( "handle %p, count %u, ptr %p, size %u stub!\n", handle, count, ptr, size );
707 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
708 return FALSE;
711 /**********************************************************************
712 * IsTouchWindow (USER32.@)
714 BOOL WINAPI IsTouchWindow( HWND hwnd, ULONG *flags )
716 FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags );
717 return FALSE;
720 /*****************************************************************************
721 * RegisterTouchWindow (USER32.@)
723 BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags )
725 FIXME( "hwnd %p, flags %#lx stub!\n", hwnd, flags );
726 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
727 return FALSE;
730 /*****************************************************************************
731 * UnregisterTouchWindow (USER32.@)
733 BOOL WINAPI UnregisterTouchWindow( HWND hwnd )
735 FIXME( "hwnd %p stub!\n", hwnd );
736 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
737 return FALSE;
740 /*****************************************************************************
741 * GetGestureInfo (USER32.@)
743 BOOL WINAPI CloseGestureInfoHandle( HGESTUREINFO handle )
745 FIXME( "handle %p stub!\n", handle );
746 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
747 return FALSE;
750 /*****************************************************************************
751 * GetGestureInfo (USER32.@)
753 BOOL WINAPI GetGestureExtraArgs( HGESTUREINFO handle, UINT count, BYTE *args )
755 FIXME( "handle %p, count %u, args %p stub!\n", handle, count, args );
756 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
757 return FALSE;
760 /*****************************************************************************
761 * GetGestureInfo (USER32.@)
763 BOOL WINAPI GetGestureInfo( HGESTUREINFO handle, GESTUREINFO *ptr )
765 FIXME( "handle %p, ptr %p stub!\n", handle, ptr );
766 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
767 return FALSE;
770 /*****************************************************************************
771 * GetGestureConfig (USER32.@)
773 BOOL WINAPI GetGestureConfig( HWND hwnd, DWORD reserved, DWORD flags, UINT *count,
774 GESTURECONFIG *config, UINT size )
776 FIXME( "handle %p, reserved %#lx, flags %#lx, count %p, config %p, size %u stub!\n",
777 hwnd, reserved, flags, count, config, size );
778 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
779 return FALSE;
782 /**********************************************************************
783 * SetGestureConfig (USER32.@)
785 BOOL WINAPI SetGestureConfig( HWND hwnd, DWORD reserved, UINT count,
786 GESTURECONFIG *config, UINT size )
788 FIXME( "handle %p, reserved %#lx, count %u, config %p, size %u stub!\n",
789 hwnd, reserved, count, config, size );
790 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
791 return FALSE;
794 BOOL WINAPI GetPointerTouchInfo( UINT32 id, POINTER_TOUCH_INFO *info )
796 FIXME( "id %u, info %p stub!\n", id, info );
797 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
798 return FALSE;
801 BOOL WINAPI GetPointerTouchInfoHistory( UINT32 id, UINT32 *count, POINTER_TOUCH_INFO *info )
803 FIXME( "id %u, count %p, info %p stub!\n", id, count, info );
804 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
805 return FALSE;
809 /*******************************************************************
810 * SetForegroundWindow (USER32.@)
812 BOOL WINAPI SetForegroundWindow( HWND hwnd )
814 return NtUserSetForegroundWindow( hwnd );
818 /*******************************************************************
819 * GetActiveWindow (USER32.@)
821 HWND WINAPI GetActiveWindow(void)
823 GUITHREADINFO info;
824 info.cbSize = sizeof(info);
825 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0;
829 /*****************************************************************
830 * GetFocus (USER32.@)
832 HWND WINAPI GetFocus(void)
834 GUITHREADINFO info;
835 info.cbSize = sizeof(info);
836 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0;
840 /*******************************************************************
841 * SetShellWindow (USER32.@)
843 BOOL WINAPI SetShellWindow( HWND hwnd )
845 return NtUserSetShellWindowEx( hwnd, hwnd );
849 /*******************************************************************
850 * GetShellWindow (USER32.@)
852 HWND WINAPI GetShellWindow(void)
854 return NtUserGetShellWindow();
858 /***********************************************************************
859 * SetProgmanWindow (USER32.@)
861 HWND WINAPI SetProgmanWindow( HWND hwnd )
863 return NtUserSetProgmanWindow( hwnd );
867 /***********************************************************************
868 * GetProgmanWindow (USER32.@)
870 HWND WINAPI GetProgmanWindow(void)
872 return NtUserGetProgmanWindow();
876 /***********************************************************************
877 * SetTaskmanWindow (USER32.@)
879 HWND WINAPI SetTaskmanWindow( HWND hwnd )
881 return NtUserSetTaskmanWindow( hwnd );
884 /***********************************************************************
885 * GetTaskmanWindow (USER32.@)
887 HWND WINAPI GetTaskmanWindow(void)
889 return NtUserGetTaskmanWindow();