1. implemented GetDoubleClickTime() and SetDoubleClickTime()

2. implemented SM_CXDOUBLECLK, SM_CYDOUBLECLK and SM_SWAPBUTTON for GetSystemMetrics()
3. implemented NtUserSystemParametersInfo() partially
4. implemented SPI_SETDOUBLECLKWIDTH, SPI_SETDOUBLECLKHEIGHT and SPI_SETDOUBLECLICKTIME for SystemParametersInfo()

svn path=/trunk/; revision=5899
This commit is contained in:
Thomas Bluemel 2003-08-28 18:04:59 +00:00
parent 303749022b
commit 7a0c1b40d1
6 changed files with 139 additions and 44 deletions

View file

@ -156,6 +156,7 @@ NtUserCallNextHookEx(
DWORD Unknown2,
DWORD Unknown3);
#define NOPARAM_ROUTINE_GETDOUBLECLICKTIME 0x01
DWORD
STDCALL
NtUserCallNoParam(
@ -1611,10 +1612,10 @@ NtUserSwitchDesktop(
DWORD
STDCALL
NtUserSystemParametersInfo(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3);
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni);
DWORD
STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: desktop.c,v 1.25 2003/08/19 15:18:26 royce Exp $
/* $Id: desktop.c,v 1.26 2003/08/28 18:04:59 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -92,6 +92,8 @@ SystemParametersInfoW(UINT uiAction,
{
case SPI_GETWORKAREA:
{
/* FIXME we should obtain the information using GetMonitorInfo(),
besides it is not the whole screen size! */
((PRECT)pvParam)->left = 0;
((PRECT)pvParam)->top = 0;
((PRECT)pvParam)->right = 640;
@ -105,6 +107,13 @@ SystemParametersInfoW(UINT uiAction,
memcpy(&nclm->lfSmCaptionFont, &CaptionFont, sizeof(CaptionFont));
return(TRUE);
}
default:
{
return NtUserSystemParametersInfo(uiAction,
uiParam,
pvParam,
fWinIni);
}
}
return(FALSE);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: input.c,v 1.16 2003/08/28 16:33:22 weiden Exp $
/* $Id: input.c,v 1.17 2003/08/28 18:04:59 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@ -101,14 +101,13 @@ GetAsyncKeyState(int vKey)
/*
* @unimplemented
* @implemented
*/
UINT
STDCALL
GetDoubleClickTime(VOID)
{
UNIMPLEMENTED;
return 0;
return (UINT)NtUserCallNoParam(NOPARAM_ROUTINE_GETDOUBLECLICKTIME);
}
@ -323,15 +322,17 @@ OemKeyScan(WORD wOemChar)
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
SetDoubleClickTime(
UINT uInterval)
{
UNIMPLEMENTED;
return FALSE;
return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
uInterval,
NULL,
0);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: metric.c,v 1.10 2003/08/20 00:41:04 silverblade Exp $
/* $Id: metric.c,v 1.11 2003/08/28 18:04:59 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -47,9 +47,12 @@
ULONG STDCALL
NtUserGetSystemMetrics(ULONG Index)
{
NTSTATUS Status;
PWINSTATION_OBJECT WinStaObject;
PWINDOW_OBJECT DesktopWindow;
ULONG Width, Height;
ULONG Width, Height, Result;
Result = 0;
switch (Index)
{
case SM_ARRANGE:
@ -69,7 +72,30 @@ NtUserGetSystemMetrics(ULONG Index)
return(3);
case SM_CXDOUBLECLK:
case SM_CYDOUBLECLK:
return(4);
case SM_SWAPBUTTON:
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
if (!NT_SUCCESS(Status))
return 0xFFFFFFFF;
switch(Index)
{
case SM_CXDOUBLECLK:
Result = WinStaObject->SystemCursor.DblClickWidth;
break;
case SM_CYDOUBLECLK:
Result = WinStaObject->SystemCursor.DblClickWidth;
break;
case SM_SWAPBUTTON:
Result = (UINT)WinStaObject->SystemCursor.SwapButtons;
break;
}
ObDereferenceObject(WinStaObject);
return Result;
case SM_CXDRAG:
case SM_CYDRAG:
return(2);
@ -134,15 +160,15 @@ NtUserGetSystemMetrics(ULONG Index)
case SM_CYSCREEN:
DesktopWindow = IntGetWindowObject(IntGetDesktopWindow());
if (NULL != DesktopWindow)
{
Width = DesktopWindow->WindowRect.right;
Height = DesktopWindow->WindowRect.bottom;
}
{
Width = DesktopWindow->WindowRect.right;
Height = DesktopWindow->WindowRect.bottom;
}
else
{
Width = 640;
Height = 480;
}
{
Width = 640;
Height = 480;
}
IntReleaseWindowObject(DesktopWindow);
return SM_CXSCREEN == Index ? Width : Height;
case SM_CXSIZE:
@ -180,7 +206,6 @@ NtUserGetSystemMetrics(ULONG Index)
case SM_SECURE:
case SM_SHOWSOUNDS:
case SM_SLOWMACHINE:
case SM_SWAPBUTTON:
return(0);
default:
return(0xFFFFFFFF);

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.13 2003/08/28 14:22:05 weiden Exp $
/* $Id: misc.c,v 1.14 2003/08/28 18:04:59 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -23,25 +23,42 @@
#include <debug.h>
/*
* @implemented
*/
DWORD
STDCALL
NtUserCallNoParam(
DWORD Routine)
{
/*
NTSTATUS Status;
DWORD Result = 0;
PWINSTATION_OBJECT WinStaObject;
switch(Routine)
{
case 1:
return 0;
case NOPARAM_ROUTINE_GETDOUBLECLICKTIME:
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
if (!NT_SUCCESS(Status))
return (DWORD)FALSE;
Result = WinStaObject->SystemCursor.DblClickSpeed;
ObDereferenceObject(WinStaObject);
return Result;
}
DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam()\n", Routine);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
*/
UNIMPLEMENTED
return 0;
}
/*
* @implemented
*/
DWORD
STDCALL
NtUserCallOneParam(
@ -115,6 +132,9 @@ NtUserCallOneParam(
}
/*
* @implemented
*/
DWORD
STDCALL
NtUserCallTwoParam(
@ -206,3 +226,55 @@ NtUserCallTwoParam(
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0;
}
/*
* @implemented
*/
DWORD
STDCALL
NtUserSystemParametersInfo(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni)
{
NTSTATUS Status;
PWINSTATION_OBJECT WinStaObject;
switch(uiAction)
{
case SPI_SETDOUBLECLKWIDTH:
case SPI_SETDOUBLECLKHEIGHT:
case SPI_SETDOUBLECLICKTIME:
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
if (!NT_SUCCESS(Status))
return (DWORD)FALSE;
switch(uiAction)
{
case SPI_SETDOUBLECLKWIDTH:
/* FIXME limit the maximum value? */
WinStaObject->SystemCursor.DblClickWidth = uiParam;
break;
case SPI_SETDOUBLECLKHEIGHT:
/* FIXME limit the maximum value? */
WinStaObject->SystemCursor.DblClickHeight = uiParam;
break;
case SPI_SETDOUBLECLICKTIME:
/* FIXME limit the maximum time to 1000 ms? */
WinStaObject->SystemCursor.DblClickSpeed = uiParam;
break;
}
/* FIXME save the value to the registry */
ObDereferenceObject(WinStaObject);
return TRUE;
}
return FALSE;
}

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.26 2003/08/25 23:24:02 rcampbell Exp $
/* $Id: stubs.c,v 1.27 2003/08/28 18:04:59 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1079,19 +1079,6 @@ NtUserShowCaret(
return 0;
}
DWORD
STDCALL
NtUserSystemParametersInfo(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
NtUserToUnicodeEx(