Ignore:
Timestamp:
May 31, 2002, 11:54:05 AM (23 years ago)
Author:
sandervl
Message:

Generate injected WH_MOUSE_LL hook event in SetCursorPos (with LLMHF_INJECTED flag set)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/winmouse.cpp

    r8347 r8533  
    1 /* $Id: winmouse.cpp,v 1.23 2002-04-30 14:54:06 sandervl Exp $ */
     1/* $Id: winmouse.cpp,v 1.24 2002-05-31 09:54:05 sandervl Exp $ */
    22/*
    33 * Win32 mouse functions
     
    3535#include "winmouse.h"
    3636#include "oslibmsg.h"
     37#include "oslibres.h"
    3738#include "pmwindow.h"
    3839#include "oslibwin.h"
     40#include "hook.h"
    3941
    4042#define DBG_LOCALLOG    DBG_winmouse
     
    5153//******************************************************************************
    5254//******************************************************************************
    53 
     55BOOL WIN32API GetCursorPos( PPOINT lpPoint)
     56{
     57    if (!lpPoint) return FALSE;
     58
     59    if (OSLibWinQueryPointerPos(lpPoint)) //POINT == POINTL
     60    {
     61        mapScreenPoint((OSLIBPOINT*)lpPoint);
     62        dprintf2(("USER32: GetCursorPos (%d,%d)", lpPoint->x, lpPoint->y));
     63        return TRUE;
     64    }
     65    else return FALSE;
     66}
     67//******************************************************************************
     68//******************************************************************************
     69BOOL WIN32API SetCursorPos( int X, int Y)
     70{
     71    BOOL ret;
     72
     73    dprintf(("USER32: SetCursorPos %d %d", X,Y));
     74    ret = OSLibWinSetPointerPos(X, mapScreenY(Y));
     75    if(ret == TRUE) {
     76        MSLLHOOKSTRUCT hook;
     77
     78        hook.pt.x        = X;
     79        hook.pt.y        = Y;
     80        hook.mouseData   = 0;
     81        //signal to dinput hook that it only needs to modify the last
     82        //known position (not treat it as a new event)
     83        hook.flags       = LLMHF_INJECTED;
     84        hook.time        = GetCurrentTime();
     85        hook.dwExtraInfo = 0;
     86
     87        HOOK_CallHooksW( WH_MOUSE_LL, HC_ACTION, WM_MOUSEMOVE, (LPARAM)&hook);
     88    }
     89    return ret;
     90}
     91//******************************************************************************
     92//******************************************************************************
     93BOOL WIN32API ClipCursor(const RECT * lpRect)
     94{
     95    if(lpRect) {
     96         dprintf(("USER32: ClipCursor (%d,%d)(%d,%d)", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom));
     97    }
     98    else dprintf(("USER32: ClipCursor NULL"));
     99    return OSLibWinClipCursor(lpRect);
     100}
     101//******************************************************************************
     102//******************************************************************************
     103BOOL WIN32API GetClipCursor( LPRECT lpRect)
     104{
     105    dprintf(("USER32: GetClipCursor %x", lpRect));
     106    return OSLibWinGetClipCursor(lpRect);
     107}
     108//******************************************************************************
    54109// capture handle "cache"
    55110static HWND hwndWin32Capture = 0;
    56 
     111//******************************************************************************
    57112HWND WIN32API GetCapture()
    58113{
Note: See TracChangeset for help on using the changeset viewer.