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.
Printable View
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.
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
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