Results 1 to 3 of 3

Thread: Not Mousemove

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    29

    Question

    How can I find out if mouse is not being moved? I have this boolaean, blnMousemove, telling if form_mousemove is called, but I've got to find out an opposite to it.

  2. #2
    Guest
    You can keep checking it's position in a Timer.

    Code:
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
    
    Private Type POINTAPI
        X As Long
        Y As Long
    End Type
    
    Dim CurPos As POINTAPI
    Dim OldX As Single
    Dim OldY As Single
    
    
    Private Sub Form_Load()
    
        Timer1.Interval = 10
        
    End Sub
    
    Private Sub Timer1_Timer()
    
        'The the coordinates of the Mouse
        Retval = GetCursorPos(CurPos)
        X = CurPos.X
        Y = CurPos.Y
        
        If OldX = X And OldY = Y Then
            'The mouse is still
            Print "Mouse is Still"
        Else
            'the Mouse is not still
            OldX = X
            OldY = Y
        End If
        
    End Sub

  3. #3
    Lively Member
    Join Date
    May 1999
    Location
    India
    Posts
    97
    hiya,

    whaddya mean by that?? i men as long as u DO NOT get the mouse move event it isn't moving right??

    or do u have something more whacky in mind??

    cheers
    Gaurav
    [email protected]
    " Programming today is a race between software-engineers striving to build bigger and
    better idiot-proof programs and the universe trying to produce bigger and better idiots.
    So far the universe is winning".
    :-)

Posting Permissions

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



Click Here to Expand Forum to Full Width