implement WM_SETCURSOR messages

svn path=/trunk/; revision=6736
This commit is contained in:
Thomas Bluemel 2003-11-21 16:36:26 +00:00
parent 83e288941c
commit b14e35b6ac
8 changed files with 50 additions and 16 deletions

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: cursor.c,v 1.15 2003/11/18 19:59:51 weiden Exp $
/* $Id: cursor.c,v 1.16 2003/11/21 16:36:26 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/cursor.c
@ -42,10 +42,20 @@ CopyBitmap(HBITMAP bmp);
NTSTATUS STDCALL
User32SetupDefaultCursors(PVOID Arguments, ULONG ArgumentLength)
{
BOOL *DefaultCursor = (BOOL*)Arguments;
LRESULT Result = TRUE;
/* FIXME load system cursor scheme */
SetCursor(0);
SetCursor(LoadCursorW(0, (LPCWSTR)IDC_ARROW));
if(*DefaultCursor)
{
/* set default cursor */
SetCursor(LoadCursorW(0, (LPCWSTR)IDC_ARROW));
}
else
{
/* FIXME load system cursor scheme */
SetCursor(0);
SetCursor(LoadCursorW(0, (LPCWSTR)IDC_ARROW));
}
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}

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: mouse.c,v 1.45 2003/11/16 12:36:24 gvg Exp $
/* $Id: mouse.c,v 1.46 2003/11/21 16:36:26 weiden Exp $
*
* PROJECT: ReactOS kernel
* PURPOSE: Mouse
@ -36,6 +36,7 @@
#include "include/msgqueue.h"
#include "include/object.h"
#include "include/winsta.h"
#include "include/window.h"
#include "include/cursoricon.h"
#include "include/callback.h"
#include <include/mouse.h>

View file

@ -47,6 +47,6 @@ HMENU STDCALL
IntLoadSysMenuTemplate();
BOOL STDCALL
IntLoadDefaultCursors();
IntLoadDefaultCursors(BOOL SetDefault);
#endif /* _WIN32K_CALLBACK_H */

View file

@ -15,6 +15,7 @@ typedef struct _CURICON_OBJECT
ICONINFO IconInfo;
} CURICON_OBJECT, *PCURICON_OBJECT;
LPARAM FASTCALL IntSendSetCursorMessage(PWINDOW_OBJECT Window, USHORT Msg, USHORT HitTest);
HCURSOR FASTCALL IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL ForceChange);
BOOL FASTCALL IntSetupCurIconHandles(PWINSTATION_OBJECT WinStaObject);
PCURICON_OBJECT FASTCALL IntGetCurIconObject(PWINSTATION_OBJECT WinStaObject, HICON hIcon);

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: callback.c,v 1.14 2003/08/29 00:24:42 weiden Exp $
/* $Id: callback.c,v 1.15 2003/11/21 16:36:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -403,7 +403,7 @@ IntLoadSysMenuTemplate()
}
BOOL STDCALL
IntLoadDefaultCursors()
IntLoadDefaultCursors(BOOL SetDefault)
{
LRESULT Result;
NTSTATUS Status;
@ -413,8 +413,8 @@ IntLoadDefaultCursors()
ResultPointer = &Result;
ResultLength = sizeof(LRESULT);
Status = NtW32Call(USER32_CALLBACK_LOADDEFAULTCURSORS,
NULL,
0,
&SetDefault,
sizeof(BOOL),
&ResultPointer,
&ResultLength);
if (!NT_SUCCESS(Status))

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: msgqueue.c,v 1.31 2003/11/18 23:33:31 weiden Exp $
/* $Id: msgqueue.c,v 1.32 2003/11/21 16:36:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -38,6 +38,7 @@
#include <include/class.h>
#include <include/object.h>
#include <include/input.h>
#include <include/cursoricon.h>
#define NDEBUG
#include <win32k/debug1.h>
@ -260,6 +261,9 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
if (Window == NULL)
{
/* set default cursor */
IntSendSetCursorMessage(NULL, Msg, HTNOWHERE);
ExFreePool(Message);
return(FALSE);
}
@ -298,6 +302,11 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
*ScreenPoint = Message->Msg.pt;
Point = Message->Msg.pt;
if(!IntSendSetCursorMessage(Window, Msg, *HitTest))
{
/* FIXME - what should we do here? */
}
if ((*HitTest) != HTCLIENT)
{

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: winsta.c,v 1.43 2003/11/17 02:12:52 hyperion Exp $
/* $Id: winsta.c,v 1.44 2003/11/21 16:36:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1027,7 +1027,7 @@ IntInitializeDesktopGraphics(VOID)
GDIOBJ_MarkObjectGlobal(ScreenDeviceContext);
EnableMouse(ScreenDeviceContext);
/* not the best place to load the cursors but it's good for now */
IntLoadDefaultCursors();
IntLoadDefaultCursors(FALSE);
NtUserAcquireOrReleaseInputOwnership(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: cursoricon.c,v 1.21 2003/11/20 21:21:29 navaraf Exp $ */
/* $Id: cursoricon.c,v 1.22 2003/11/21 16:36:26 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
@ -25,7 +25,6 @@
#include <win32k/win32k.h>
#include <windows.h>
#include <stdlib.h>
#include <win32k/cursoricon.h>
#include <win32k/bitmaps.h>
#include <win32k/dc.h>
#include <include/winsta.h>
@ -37,7 +36,7 @@
#include <include/surface.h>
#include <include/palette.h>
#include <include/eng.h>
#include <include/inteng.h>
#include <include/callback.h>
#include "include/object.h"
#include <internal/safe.h>
@ -64,6 +63,20 @@ IntCopyBitmap(HBITMAP bmp)
return ret;
}
LPARAM FASTCALL
IntSendSetCursorMessage(PWINDOW_OBJECT Window, USHORT Msg, USHORT HitTest)
{
/* FIXME - high-order word of lParam is 0 if we're in menu mode */
if(Window)
return IntSendMessage(Window->Self, WM_SETCURSOR, (WPARAM)Window->Self, MAKELPARAM(HitTest, Msg), FALSE);
else
{
/* set default cursor */
IntLoadDefaultCursors(TRUE);
return 1;
}
}
#define COLORCURSORS_ALLOWED FALSE
HCURSOR FASTCALL