update for HEAD-2003091401
[reactos.git] / lib / user32 / windows / input.c
index 29a16b6..63b727c 100644 (file)
 
 /* FUNCTIONS *****************************************************************/
 
+
+/*
+ * @implemented
+ */
+WINBOOL
+STDCALL
+DragDetect(
+  HWND hWnd,
+  POINT pt)
+{
+  return NtUserDragDetect(hWnd, pt.x, pt.y);
+}
+
+
+/*
+ * @unimplemented
+ */
 HKL STDCALL
 ActivateKeyboardLayout(HKL hkl,
                       UINT Flags)
 {
+  UNIMPLEMENTED;
   return (HKL)0;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 BlockInput(WINBOOL fBlockIt)
 {
+  UNIMPLEMENTED;
   return FALSE;
 }
 
+
+/*
+ * @implemented
+ */
 WINBOOL STDCALL
 EnableWindow(HWND hWnd,
             WINBOOL bEnable)
 {
-  return FALSE;
+    LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
+    Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
+    NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
+    
+    SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
+    
+    // Return nonzero if it was disabled, or zero if it wasn't:
+    return IsWindowEnabled(hWnd);
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 GetAsyncKeyState(int vKey)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @implemented
+ */
+UINT
+STDCALL
+GetDoubleClickTime(VOID)
+{
+  return NtUserGetDoubleClickTime();
+}
+
+
+/*
+ * @unimplemented
+ */
 HKL STDCALL
 GetKeyboardLayout(DWORD idThread)
 {
+  UNIMPLEMENTED;
   return (HKL)0;
 }
 
-WINBOOL STDCALL GetInputState(VOID)
-{
-  return FALSE;
-}
 
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 GetKBCodePage(VOID)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 GetKeyNameTextA(LONG lParam,
                LPSTR lpString,
                int nSize)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 GetKeyNameTextW(LONG lParam,
                LPWSTR lpString,
                int nSize)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 GetKeyState(int nVirtKey)
 {
 return 0;
return (SHORT) NtUserGetKeyState((DWORD) nVirtKey);
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 GetKeyboardLayoutList(int nBuff,
                      HKL FAR *lpList)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 GetKeyboardLayoutNameA(LPSTR pwszKLID)
 {
+  UNIMPLEMENTED;
   return FALSE;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 GetKeyboardLayoutNameW(LPWSTR pwszKLID)
 {
+  UNIMPLEMENTED;
   return FALSE;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 GetKeyboardState(PBYTE lpKeyState)
 {
-  return FALSE;
+  
+  return (WINBOOL) NtUserGetKeyboardState((LPBYTE) lpKeyState);
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 GetKeyboardType(int nTypeFlag)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 GetLastInputInfo(PLASTINPUTINFO plii)
 {
+  UNIMPLEMENTED;
   return FALSE;
 }
 
+
+/*
+ * @unimplemented
+ */
 HKL STDCALL
 LoadKeyboardLayoutA(LPCSTR pwszKLID,
                    UINT Flags)
 {
+  UNIMPLEMENTED;
   return (HKL)0;
 }
 
+
+/*
+ * @unimplemented
+ */
 HKL STDCALL
 LoadKeyboardLayoutW(LPCWSTR pwszKLID,
                    UINT Flags)
 {
+  UNIMPLEMENTED;
   return (HKL)0;
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 MapVirtualKeyA(UINT uCode,
               UINT uMapType)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 MapVirtualKeyExA(UINT uCode,
                 UINT uMapType,
                 HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 MapVirtualKeyExW(UINT uCode,
                 UINT uMapType,
                 HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT STDCALL
 MapVirtualKeyW(UINT uCode,
               UINT uMapType)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 DWORD STDCALL
 OemKeyScan(WORD wOemChar)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @implemented
+ */
+WINBOOL
+STDCALL
+SetDoubleClickTime(
+  UINT uInterval)
+{
+  return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
+                                             uInterval,
+                                             NULL,
+                                             0);
+}
+
+
+/*
+ * @unimplemented
+ */
+HWND STDCALL
+SetFocus(HWND hWnd)
+{
+  return NtUserSetFocus(hWnd);
+}
+
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 SetKeyboardState(LPBYTE lpKeyState)
 {
-  return FALSE;
+ return (WINBOOL) NtUserSetKeyboardState((LPBYTE)lpKeyState);
+}
+
+
+/*
+ * @implemented
+ */
+WINBOOL
+STDCALL
+SwapMouseButton(
+  WINBOOL fSwap)
+{
+  return (WINBOOL)NtUserCallOneParam((DWORD)fSwap, 
+                                     ONEPARAM_ROUTINE_SWAPMOUSEBUTTON);
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 ToAscii(UINT uVirtKey,
        UINT uScanCode,
@@ -199,9 +379,14 @@ ToAscii(UINT uVirtKey,
        LPWORD lpChar,
        UINT uFlags)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 ToAsciiEx(UINT uVirtKey,
          UINT uScanCode,
@@ -210,9 +395,14 @@ ToAsciiEx(UINT uVirtKey,
          UINT uFlags,
          HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 ToUnicode(UINT wVirtKey,
          UINT wScanCode,
@@ -221,9 +411,14 @@ ToUnicode(UINT wVirtKey,
          int cchBuff,
          UINT wFlags)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 int STDCALL
 ToUnicodeEx(UINT wVirtKey,
            UINT wScanCode,
@@ -233,41 +428,71 @@ ToUnicodeEx(UINT wVirtKey,
            UINT wFlags,
            HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 WINBOOL STDCALL
 UnloadKeyboardLayout(HKL hkl)
 {
+  UNIMPLEMENTED;
   return FALSE;
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 VkKeyScanA(CHAR ch)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 VkKeyScanExA(CHAR ch,
             HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 VkKeyScanExW(WCHAR ch,
             HKL dwhkl)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 SHORT STDCALL
 VkKeyScanW(WCHAR ch)
 {
+  UNIMPLEMENTED;
   return 0;
 }
 
+
+/*
+ * @unimplemented
+ */
 UINT
 STDCALL
 SendInput(
@@ -275,5 +500,6 @@ SendInput(
   LPINPUT pInputs,
   int cbSize)
 {
+  UNIMPLEMENTED;
   return 0;
 }