Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Type POINTAPI
X As Long
Y As Long
End Type
Function IsOn(Objet As Object) As Boolean
Dim Cursor As POINTAPI
Call GetCursorPos(Cursor)
If (WindowFromPoint(Cursor.X, Cursor.Y) = Objet.hWnd) Then
IsOn = True
Else
IsOn = False
End If
End Function
Bien pensé mais pas trop efficace d'utiliser le mousemouve. Si tu passses trop vite par dessus l'image, des fois elle reste allumée d'autres fois elle n'allume pas... L'idéal est d'utiliser la position relative du curseur de la souris avec l'api getcursorpos. J'ai sûrement un exemple en quelque part... Si je trouve, je met mon code...
20 oct. 2001 à 22:15
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Type POINTAPI
X As Long
Y As Long
End Type
Function IsOn(Objet As Object) As Boolean
Dim Cursor As POINTAPI
Call GetCursorPos(Cursor)
If (WindowFromPoint(Cursor.X, Cursor.Y) = Objet.hWnd) Then
IsOn = True
Else
IsOn = False
End If
End Function
20 oct. 2001 à 17:14
Bye
20 oct. 2001 à 03:44
20 oct. 2001 à 01:57
20 oct. 2001 à 01:56
20 oct. 2001 à 00:02
..tres tres laid