wined3d: Check the wined3d resource type and usage instead of the GL target in textur...
[wine.git] / dlls / user32 / input.c
blob8f3cd8acae7b198bfefc8eeb868061a51d58e2cc
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;
41 LANGID langid;
43 /* FIXME:
45 * layout = main_key_tab[kbd_layout].lcid;
47 * Winword uses return value of GetKeyboardLayout as a codepage
48 * to translate ANSI keyboard messages to unicode. But we have
49 * a problem with it: for instance Polish keyboard layout is
50 * identical to the US one, and therefore instead of the Polish
51 * locale id we return the US one.
54 layout = GetUserDefaultLCID();
57 * Microsoft Office expects this value to be something specific
58 * for Japanese and Korean Windows with an IME the value is 0xe001
59 * We should probably check to see if an IME exists and if so then
60 * set this word properly.
62 langid = PRIMARYLANGID( LANGIDFROMLCID( layout ) );
63 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN)
64 layout = MAKELONG( layout, 0xe001 ); /* IME */
65 else
66 layout = MAKELONG( layout, layout );
68 return (HKL)layout;
72 /***********************************************************************
73 * keybd_event (USER32.@)
75 void WINAPI keybd_event( BYTE bVk, BYTE bScan,
76 DWORD dwFlags, ULONG_PTR dwExtraInfo )
78 INPUT input;
80 input.type = INPUT_KEYBOARD;
81 input.ki.wVk = bVk;
82 input.ki.wScan = bScan;
83 input.ki.dwFlags = dwFlags;
84 input.ki.time = 0;
85 input.ki.dwExtraInfo = dwExtraInfo;
86 NtUserSendInput( 1, &input, sizeof(input) );
90 /***********************************************************************
91 * mouse_event (USER32.@)
93 void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
94 DWORD dwData, ULONG_PTR dwExtraInfo )
96 INPUT input;
98 input.type = INPUT_MOUSE;
99 input.mi.dx = dx;
100 input.mi.dy = dy;
101 input.mi.mouseData = dwData;
102 input.mi.dwFlags = dwFlags;
103 input.mi.time = 0;
104 input.mi.dwExtraInfo = dwExtraInfo;
105 NtUserSendInput( 1, &input, sizeof(input) );
109 /***********************************************************************
110 * GetCursorPos (USER32.@)
112 BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
114 return NtUserGetCursorPos( pt );
118 /**********************************************************************
119 * ReleaseCapture (USER32.@)
121 BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture(void)
123 return NtUserReleaseCapture();
127 /**********************************************************************
128 * GetCapture (USER32.@)
130 HWND WINAPI GetCapture(void)
132 GUITHREADINFO info;
133 info.cbSize = sizeof(info);
134 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndCapture : 0;
138 /*****************************************************************
139 * DestroyCaret (USER32.@)
141 BOOL WINAPI DestroyCaret(void)
143 return NtUserDestroyCaret();
147 /*****************************************************************
148 * SetCaretPos (USER32.@)
150 BOOL WINAPI SetCaretPos( int x, int y )
152 return NtUserSetCaretPos( x, y );
156 /*****************************************************************
157 * SetCaretBlinkTime (USER32.@)
159 BOOL WINAPI SetCaretBlinkTime( unsigned int time )
161 return NtUserSetCaretBlinkTime( time );
165 /***********************************************************************
166 * GetInputState (USER32.@)
168 BOOL WINAPI GetInputState(void)
170 return NtUserGetInputState();
174 /******************************************************************
175 * GetLastInputInfo (USER32.@)
177 BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii)
179 BOOL ret;
181 TRACE("%p\n", plii);
183 if (plii->cbSize != sizeof (*plii) )
185 SetLastError(ERROR_INVALID_PARAMETER);
186 return FALSE;
189 SERVER_START_REQ( get_last_input_time )
191 ret = !wine_server_call_err( req );
192 if (ret)
193 plii->dwTime = reply->time;
195 SERVER_END_REQ;
196 return ret;
200 /**********************************************************************
201 * VkKeyScanA (USER32.@)
203 * VkKeyScan translates an ANSI character to a virtual-key and shift code
204 * for the current keyboard.
205 * high-order byte yields :
206 * 0 Unshifted
207 * 1 Shift
208 * 2 Ctrl
209 * 3-5 Shift-key combinations that are not used for characters
210 * 6 Ctrl-Alt
211 * 7 Ctrl-Alt-Shift
212 * I.e. : Shift = 1, Ctrl = 2, Alt = 4.
213 * FIXME : works ok except for dead chars :
214 * VkKeyScan '^'(0x5e, 94) ... got keycode 00 ... returning 00
215 * VkKeyScan '`'(0x60, 96) ... got keycode 00 ... returning 00
217 SHORT WINAPI VkKeyScanA(CHAR cChar)
219 WCHAR wChar;
221 if (IsDBCSLeadByte(cChar)) return -1;
223 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
224 return VkKeyScanW(wChar);
227 /******************************************************************************
228 * VkKeyScanW (USER32.@)
230 SHORT WINAPI VkKeyScanW(WCHAR cChar)
232 return NtUserVkKeyScanEx( cChar, NtUserGetKeyboardLayout(0) );
235 /**********************************************************************
236 * VkKeyScanExA (USER32.@)
238 WORD WINAPI VkKeyScanExA(CHAR cChar, HKL dwhkl)
240 WCHAR wChar;
242 if (IsDBCSLeadByte(cChar)) return -1;
244 MultiByteToWideChar(CP_ACP, 0, &cChar, 1, &wChar, 1);
245 return NtUserVkKeyScanEx( wChar, dwhkl );
248 /**********************************************************************
249 * OemKeyScan (USER32.@)
251 DWORD WINAPI OemKeyScan( WORD oem )
253 WCHAR wchr;
254 DWORD vkey, scan;
255 char oem_char = LOBYTE( oem );
257 if (!OemToCharBuffW( &oem_char, &wchr, 1 ))
258 return -1;
260 vkey = VkKeyScanW( wchr );
261 scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
262 if (!scan) return -1;
264 vkey &= 0xff00;
265 vkey <<= 8;
266 return vkey | scan;
269 /******************************************************************************
270 * GetKeyboardType (USER32.@)
272 INT WINAPI GetKeyboardType(INT nTypeFlag)
274 TRACE_(keyboard)("(%d)\n", nTypeFlag);
275 if (LOWORD(NtUserGetKeyboardLayout(0)) == MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN))
277 /* scan code for `_', the key left of r-shift, in Japanese 106 keyboard */
278 const UINT JP106_VSC_USCORE = 0x73;
280 switch(nTypeFlag)
282 case 0: /* Keyboard type */
283 return 7; /* Japanese keyboard */
284 case 1: /* Keyboard Subtype */
285 /* Test keyboard mappings to detect Japanese keyboard */
286 if (MapVirtualKeyW(VK_OEM_102, MAPVK_VK_TO_VSC) == JP106_VSC_USCORE
287 && MapVirtualKeyW(JP106_VSC_USCORE, MAPVK_VSC_TO_VK) == VK_OEM_102)
288 return 2; /* Japanese 106 */
289 else
290 return 0; /* AT-101 */
291 case 2: /* Number of F-keys */
292 return 12; /* It has 12 F-keys */
295 else
297 switch(nTypeFlag)
299 case 0: /* Keyboard type */
300 return 4; /* AT-101 */
301 case 1: /* Keyboard Subtype */
302 return 0; /* There are no defined subtypes */
303 case 2: /* Number of F-keys */
304 return 12; /* We're doing an 101 for now, so return 12 F-keys */
307 WARN_(keyboard)("Unknown type\n");
308 return 0; /* The book says 0 here, so 0 */
311 /******************************************************************************
312 * MapVirtualKeyA (USER32.@)
314 UINT WINAPI MapVirtualKeyA(UINT code, UINT maptype)
316 return MapVirtualKeyExA( code, maptype, NtUserGetKeyboardLayout(0) );
319 /******************************************************************************
320 * MapVirtualKeyW (USER32.@)
322 UINT WINAPI MapVirtualKeyW(UINT code, UINT maptype)
324 return NtUserMapVirtualKeyEx( code, maptype, NtUserGetKeyboardLayout(0) );
327 /******************************************************************************
328 * MapVirtualKeyExA (USER32.@)
330 UINT WINAPI MapVirtualKeyExA(UINT code, UINT maptype, HKL hkl)
332 UINT ret;
334 ret = NtUserMapVirtualKeyEx( code, maptype, hkl );
335 if (maptype == MAPVK_VK_TO_CHAR)
337 BYTE ch = 0;
338 WCHAR wch = ret;
340 WideCharToMultiByte( CP_ACP, 0, &wch, 1, (LPSTR)&ch, 1, NULL, NULL );
341 ret = ch;
343 return ret;
346 /****************************************************************************
347 * GetKBCodePage (USER32.@)
349 UINT WINAPI GetKBCodePage(void)
351 return GetOEMCP();
354 /****************************************************************************
355 * GetKeyboardLayoutNameA (USER32.@)
357 BOOL WINAPI GetKeyboardLayoutNameA(LPSTR pszKLID)
359 WCHAR buf[KL_NAMELENGTH];
361 if (NtUserGetKeyboardLayoutName( buf ))
362 return WideCharToMultiByte( CP_ACP, 0, buf, -1, pszKLID, KL_NAMELENGTH, NULL, NULL ) != 0;
363 return FALSE;
366 /****************************************************************************
367 * GetKeyNameTextA (USER32.@)
369 INT WINAPI GetKeyNameTextA(LONG lParam, LPSTR lpBuffer, INT nSize)
371 WCHAR buf[256];
372 INT ret;
374 if (!nSize || !NtUserGetKeyNameText( lParam, buf, ARRAYSIZE(buf) ))
376 lpBuffer[0] = 0;
377 return 0;
379 ret = WideCharToMultiByte(CP_ACP, 0, buf, -1, lpBuffer, nSize, NULL, NULL);
380 if (!ret && nSize)
382 ret = nSize - 1;
383 lpBuffer[ret] = 0;
385 else ret--;
387 return ret;
390 /****************************************************************************
391 * ToUnicode (USER32.@)
393 INT WINAPI ToUnicode( UINT virt, UINT scan, const BYTE *state, LPWSTR str, int size, UINT flags )
395 return NtUserToUnicodeEx( virt, scan, state, str, size, flags, NtUserGetKeyboardLayout(0) );
398 /****************************************************************************
399 * ToAscii (USER32.@)
401 INT WINAPI ToAscii( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
402 LPWORD lpChar, UINT flags )
404 return ToAsciiEx( virtKey, scanCode, lpKeyState, lpChar, flags,
405 NtUserGetKeyboardLayout(0) );
408 /****************************************************************************
409 * ToAsciiEx (USER32.@)
411 INT WINAPI ToAsciiEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
412 LPWORD lpChar, UINT flags, HKL dwhkl )
414 WCHAR uni_chars[2];
415 INT ret, n_ret;
417 ret = NtUserToUnicodeEx( virtKey, scanCode, lpKeyState, uni_chars, 2, flags, dwhkl );
418 if (ret < 0) n_ret = 1; /* FIXME: make ToUnicode return 2 for dead chars */
419 else n_ret = ret;
420 WideCharToMultiByte(CP_ACP, 0, uni_chars, n_ret, (LPSTR)lpChar, 2, NULL, NULL);
421 return ret;
424 /**********************************************************************
425 * BlockInput (USER32.@)
427 BOOL WINAPI BlockInput(BOOL fBlockIt)
429 FIXME_(keyboard)("(%d): stub\n", fBlockIt);
430 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
432 return FALSE;
436 /***********************************************************************
437 * LoadKeyboardLayoutW (USER32.@)
439 HKL WINAPI LoadKeyboardLayoutW( const WCHAR *name, UINT flags )
441 WCHAR layout_path[MAX_PATH], value[5];
442 LCID locale = GetUserDefaultLCID();
443 DWORD id, value_size, tmp;
444 HKEY hkey;
445 HKL layout;
447 FIXME_(keyboard)( "name %s, flags %x, semi-stub!\n", debugstr_w( name ), flags );
449 tmp = wcstoul( name, NULL, 16 );
450 if (HIWORD( tmp )) layout = UlongToHandle( tmp );
451 else layout = UlongToHandle( MAKELONG( LOWORD( tmp ), LOWORD( tmp ) ) );
453 if (!((UINT_PTR)layout >> 28)) id = LOWORD( tmp );
454 else id = HIWORD( layout ); /* IME or aliased layout */
456 wcscpy( layout_path, L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\" );
457 wcscat( layout_path, name );
459 if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, layout_path, &hkey ))
461 value_size = sizeof(value);
462 if (!RegGetValueW( hkey, NULL, L"Layout Id", RRF_RT_REG_SZ, NULL, (void *)&value, &value_size ))
463 id = 0xf000 | (wcstoul( value, NULL, 16 ) & 0xfff);
465 RegCloseKey( hkey );
468 layout = UlongToHandle( MAKELONG( locale, id ) );
469 if ((flags & KLF_ACTIVATE) && NtUserActivateKeyboardLayout( layout, 0 )) return layout;
471 /* FIXME: semi-stub: returning default layout */
472 return get_locale_kbd_layout();
475 /***********************************************************************
476 * LoadKeyboardLayoutA (USER32.@)
478 HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags)
480 HKL ret;
481 UNICODE_STRING pwszKLIDW;
483 if (pwszKLID) RtlCreateUnicodeStringFromAsciiz(&pwszKLIDW, pwszKLID);
484 else pwszKLIDW.Buffer = NULL;
486 ret = LoadKeyboardLayoutW(pwszKLIDW.Buffer, Flags);
487 RtlFreeUnicodeString(&pwszKLIDW);
488 return ret;
492 /***********************************************************************
493 * UnloadKeyboardLayout (USER32.@)
495 BOOL WINAPI UnloadKeyboardLayout( HKL layout )
497 FIXME_(keyboard)( "layout %p, stub!\n", layout );
498 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
499 return FALSE;
503 static DWORD CALLBACK devnotify_window_callbackW(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
505 SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
506 return 0;
509 static DWORD CALLBACK devnotify_window_callbackA(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
511 if (flags & 0x8000)
513 switch (header->dbch_devicetype)
515 case DBT_DEVTYP_DEVICEINTERFACE:
517 const DEV_BROADCAST_DEVICEINTERFACE_W *ifaceW = (const DEV_BROADCAST_DEVICEINTERFACE_W *)header;
518 size_t lenW = wcslen( ifaceW->dbcc_name );
519 DEV_BROADCAST_DEVICEINTERFACE_A *ifaceA;
520 DWORD lenA;
522 if (!(ifaceA = malloc( offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenW * 3 + 1]) )))
523 return 0;
524 lenA = WideCharToMultiByte( CP_ACP, 0, ifaceW->dbcc_name, lenW + 1,
525 ifaceA->dbcc_name, lenW * 3 + 1, NULL, NULL );
527 ifaceA->dbcc_size = offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[lenA + 1]);
528 ifaceA->dbcc_devicetype = ifaceW->dbcc_devicetype;
529 ifaceA->dbcc_reserved = ifaceW->dbcc_reserved;
530 ifaceA->dbcc_classguid = ifaceW->dbcc_classguid;
531 SendMessageTimeoutA( handle, WM_DEVICECHANGE, flags, (LPARAM)ifaceA, SMTO_ABORTIFHUNG, 2000, NULL );
532 free( ifaceA );
533 return 0;
536 default:
537 FIXME( "unimplemented W to A mapping for %#lx\n", header->dbch_devicetype );
538 /* fall through */
539 case DBT_DEVTYP_HANDLE:
540 case DBT_DEVTYP_OEM:
541 break;
545 SendMessageTimeoutA( handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL );
546 return 0;
549 static DWORD CALLBACK devnotify_service_callback(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header)
551 FIXME("Support for service handles is not yet implemented!\n");
552 return 0;
555 struct device_notification_details
557 DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header);
558 HANDLE handle;
559 union
561 DEV_BROADCAST_HDR header;
562 DEV_BROADCAST_DEVICEINTERFACE_W iface;
563 } filter;
566 extern HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_details *details,
567 void *filter, DWORD flags );
568 extern BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle );
570 /***********************************************************************
571 * RegisterDeviceNotificationA (USER32.@)
573 * See RegisterDeviceNotificationW.
575 HDEVNOTIFY WINAPI RegisterDeviceNotificationA( HANDLE handle, void *filter, DWORD flags )
577 return RegisterDeviceNotificationW( handle, filter, flags );
580 /***********************************************************************
581 * RegisterDeviceNotificationW (USER32.@)
583 HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWORD flags )
585 struct device_notification_details details;
586 DEV_BROADCAST_HDR *header = filter;
588 TRACE("handle %p, filter %p, flags %#lx\n", handle, filter, flags);
590 if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES))
592 SetLastError( ERROR_INVALID_PARAMETER );
593 return NULL;
596 if (!(flags & DEVICE_NOTIFY_SERVICE_HANDLE) && !IsWindow( handle ))
598 SetLastError( ERROR_INVALID_PARAMETER );
599 return NULL;
602 if (!header) details.filter.header.dbch_devicetype = 0;
603 else if (header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
605 DEV_BROADCAST_DEVICEINTERFACE_W *iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)header;
606 details.filter.iface = *iface;
608 if (flags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
609 details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_classguid );
610 else
611 details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name );
613 else if (header->dbch_devicetype == DBT_DEVTYP_HANDLE)
615 FIXME( "DBT_DEVTYP_HANDLE filter type not implemented\n" );
616 details.filter.header.dbch_devicetype = 0;
618 else
620 SetLastError( ERROR_INVALID_DATA );
621 return NULL;
624 details.handle = handle;
626 if (flags & DEVICE_NOTIFY_SERVICE_HANDLE)
627 details.cb = devnotify_service_callback;
628 else if (IsWindowUnicode( handle ))
629 details.cb = devnotify_window_callbackW;
630 else
631 details.cb = devnotify_window_callbackA;
633 return I_ScRegisterDeviceNotification( &details, filter, 0 );
636 /***********************************************************************
637 * UnregisterDeviceNotification (USER32.@)
639 BOOL WINAPI UnregisterDeviceNotification( HDEVNOTIFY handle )
641 TRACE("%p\n", handle);
643 return I_ScUnregisterDeviceNotification( handle );
646 /***********************************************************************
647 * GetRawInputDeviceInfoA (USER32.@)
649 UINT WINAPI GetRawInputDeviceInfoA( HANDLE device, UINT command, void *data, UINT *size )
651 TRACE( "device %p, command %#x, data %p, size %p.\n", device, command, data, size );
653 /* RIDI_DEVICENAME size is in chars, not bytes */
654 if (command == RIDI_DEVICENAME)
656 WCHAR *nameW;
657 UINT ret, sizeW;
659 if (!size) return ~0U;
661 sizeW = *size;
663 if (data && sizeW > 0)
664 nameW = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * sizeW );
665 else
666 nameW = NULL;
668 ret = NtUserGetRawInputDeviceInfo( device, command, nameW, &sizeW );
670 if (ret && ret != ~0U)
671 WideCharToMultiByte( CP_ACP, 0, nameW, -1, data, *size, NULL, NULL );
673 *size = sizeW;
675 HeapFree( GetProcessHeap(), 0, nameW );
677 return ret;
680 return NtUserGetRawInputDeviceInfo( device, command, data, size );
683 /***********************************************************************
684 * DefRawInputProc (USER32.@)
686 LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_size )
688 TRACE( "data %p, data_count %d, header_size %u.\n", data, data_count, header_size );
690 return header_size == sizeof(RAWINPUTHEADER) ? 0 : -1;
693 /*****************************************************************************
694 * CloseTouchInputHandle (USER32.@)
696 BOOL WINAPI CloseTouchInputHandle( HTOUCHINPUT handle )
698 FIXME( "handle %p stub!\n", handle );
699 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
700 return FALSE;
703 /*****************************************************************************
704 * GetTouchInputInfo (USER32.@)
706 BOOL WINAPI GetTouchInputInfo( HTOUCHINPUT handle, UINT count, TOUCHINPUT *ptr, int size )
708 FIXME( "handle %p, count %u, ptr %p, size %u stub!\n", handle, count, ptr, size );
709 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
710 return FALSE;
713 /**********************************************************************
714 * IsTouchWindow (USER32.@)
716 BOOL WINAPI IsTouchWindow( HWND hwnd, ULONG *flags )
718 FIXME( "hwnd %p, flags %p stub!\n", hwnd, flags );
719 return FALSE;
722 /*****************************************************************************
723 * RegisterTouchWindow (USER32.@)
725 BOOL WINAPI RegisterTouchWindow( HWND hwnd, ULONG flags )
727 FIXME( "hwnd %p, flags %#lx stub!\n", hwnd, flags );
728 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
729 return FALSE;
732 /*****************************************************************************
733 * UnregisterTouchWindow (USER32.@)
735 BOOL WINAPI UnregisterTouchWindow( HWND hwnd )
737 FIXME( "hwnd %p stub!\n", hwnd );
738 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
739 return FALSE;
742 /*****************************************************************************
743 * GetGestureInfo (USER32.@)
745 BOOL WINAPI CloseGestureInfoHandle( HGESTUREINFO handle )
747 FIXME( "handle %p stub!\n", handle );
748 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
749 return FALSE;
752 /*****************************************************************************
753 * GetGestureInfo (USER32.@)
755 BOOL WINAPI GetGestureExtraArgs( HGESTUREINFO handle, UINT count, BYTE *args )
757 FIXME( "handle %p, count %u, args %p stub!\n", handle, count, args );
758 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
759 return FALSE;
762 /*****************************************************************************
763 * GetGestureInfo (USER32.@)
765 BOOL WINAPI GetGestureInfo( HGESTUREINFO handle, GESTUREINFO *ptr )
767 FIXME( "handle %p, ptr %p stub!\n", handle, ptr );
768 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
769 return FALSE;
772 /*****************************************************************************
773 * GetGestureConfig (USER32.@)
775 BOOL WINAPI GetGestureConfig( HWND hwnd, DWORD reserved, DWORD flags, UINT *count,
776 GESTURECONFIG *config, UINT size )
778 FIXME( "handle %p, reserved %#lx, flags %#lx, count %p, config %p, size %u stub!\n",
779 hwnd, reserved, flags, count, config, size );
780 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
781 return FALSE;
784 /**********************************************************************
785 * SetGestureConfig (USER32.@)
787 BOOL WINAPI SetGestureConfig( HWND hwnd, DWORD reserved, UINT count,
788 GESTURECONFIG *config, UINT size )
790 FIXME( "handle %p, reserved %#lx, count %u, config %p, size %u stub!\n",
791 hwnd, reserved, count, config, size );
792 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
793 return FALSE;
796 BOOL WINAPI GetPointerTouchInfo( UINT32 id, POINTER_TOUCH_INFO *info )
798 FIXME( "id %u, info %p stub!\n", id, info );
799 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
800 return FALSE;
803 BOOL WINAPI GetPointerTouchInfoHistory( UINT32 id, UINT32 *count, POINTER_TOUCH_INFO *info )
805 FIXME( "id %u, count %p, info %p stub!\n", id, count, info );
806 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
807 return FALSE;
811 /*******************************************************************
812 * SetForegroundWindow (USER32.@)
814 BOOL WINAPI SetForegroundWindow( HWND hwnd )
816 return NtUserSetForegroundWindow( hwnd );
820 /*******************************************************************
821 * GetActiveWindow (USER32.@)
823 HWND WINAPI GetActiveWindow(void)
825 GUITHREADINFO info;
826 info.cbSize = sizeof(info);
827 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0;
831 /*****************************************************************
832 * GetFocus (USER32.@)
834 HWND WINAPI GetFocus(void)
836 GUITHREADINFO info;
837 info.cbSize = sizeof(info);
838 return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0;
842 /*******************************************************************
843 * SetShellWindow (USER32.@)
845 BOOL WINAPI SetShellWindow( HWND hwnd )
847 return NtUserSetShellWindowEx( hwnd, hwnd );
851 /*******************************************************************
852 * GetShellWindow (USER32.@)
854 HWND WINAPI GetShellWindow(void)
856 return NtUserGetShellWindow();
860 /***********************************************************************
861 * SetProgmanWindow (USER32.@)
863 HWND WINAPI SetProgmanWindow( HWND hwnd )
865 return NtUserSetProgmanWindow( hwnd );
869 /***********************************************************************
870 * GetProgmanWindow (USER32.@)
872 HWND WINAPI GetProgmanWindow(void)
874 return NtUserGetProgmanWindow();
878 /***********************************************************************
879 * SetTaskmanWindow (USER32.@)
881 HWND WINAPI SetTaskmanWindow( HWND hwnd )
883 return NtUserSetTaskmanWindow( hwnd );
886 /***********************************************************************
887 * GetTaskmanWindow (USER32.@)
889 HWND WINAPI GetTaskmanWindow(void)
891 return NtUserGetTaskmanWindow();