Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
Mouse pos

Results 1 to 6 of 6

Thread: Mouse pos

  1. #1
    Semi-Coder t00ny's Avatar
    Join Date
    Jan 2008
    Posts
    361

    Mouse pos

    Hey all ! I'm working on a hack for cod2, and i wud like to use mouse, but when i do :
    Code:
    POINT pt;
    if( GetCursorPos( &pt ) != 0)
    {
    x = pt.x;
    y = pt.y;
    
    }
    it only returns : 512, 393, it's middle of screen, but i wud like to find the pos of muse in game;

    thx

  2. #2
    Coders Shard's Avatar
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    213

    Re: Mouse pos

    That's because the Q3 engine centres the (Windows) cursor each frame, it only uses the mouse input, not the actual mouse position, so Get/SetCursorPos won't be any use. If you want the viewangles, you can read them directly from the games memory.

  3. #3
    Semi-Coder t00ny's Avatar
    Join Date
    Jan 2008
    Posts
    361

    Re: Mouse pos

    I mean, i want to find mouse X and Y on the main menu for example.
    Should i find them in memory ?

  4. #4
    Coders siLenCer's Avatar
    Join Date
    May 2007
    Posts
    443

    Re: Mouse pos

    Are you trying to some kind of mouse-controlled GUI? If so... here's a little snippet from my menu. Call it every frame (I call it in EndFrame) and the cursor's coordinates will be stored in CursorX and CursorY.

    The code below is compatible with windowed mode... that's why in the last two lines the window position is subtracted from the cursor position

    Code:
    int CursorX, CursorY;
    
    RECT Window;
    POINT pPoint;
    HWND CoD4Handle;
    WINDOWPLACEMENT WinPlace;
    
    void DRAWING::Menu()
    {
        // Placement Organization
        GetCursorPos( &pPoint );
        CoD4Handle = FindWindow( 0, "Call of Duty 4" );  
        GetWindowPlacement( CoD4Handle, &WinPlace );
    
        CursorX = pPoint.x - WinPlace.rcNormalPosition.left;
        CursorY = pPoint.y - WinPlace.rcNormalPosition.top;
    }

  5. #5
    Semi-Coder t00ny's Avatar
    Join Date
    Jan 2008
    Posts
    361

    Re: Mouse pos

    Ok thank you a lot Silencer

    But i found addies too :
    Code:
    X = 01978034
    Y = 01978038
    I'm not sure of the X or Y value, i forgot to write them down xD

  6. #6
    Semi-Coder t00ny's Avatar
    Join Date
    Jan 2008
    Posts
    361

    Re: Mouse pos

    I've a new prob now. i want my cursor to show when it's over something i draw. Atm, it's hidden when something is drawn over the mouse.
    How to make the mouse always visible ?

Similar Threads

  1. [QL] Mouse unlock
    By mowl in forum Client Hooks
    Replies: 0
    Last Post: January 14th, 2011, 17:50
  2. Replies: 4
    Last Post: March 2nd, 2009, 01:10
  3. Help my mouse won't work
    By Natare in forum Hardware
    Replies: 1
    Last Post: November 12th, 2008, 13:18
  4. Mouse and GUI
    By t00ny in forum Client Hooks
    Replies: 18
    Last Post: July 2nd, 2008, 16:45
  5. Whats Ur Mouse?
    By ZeLL in forum Hardware
    Replies: 54
    Last Post: January 18th, 2008, 14:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •