Urvin писал(а):dim a as boolean
onMouseMove
if a = false playsound(...)
a=true
onFormMouseMove
a=false
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
PlaySound
Dim cursor As POINTAPI
Do
DoEvents
GetCursorPos cursor
If cursor.X < Command1.Left + Me.Left And cursor.Y < Me.Top + Command1.Top Or _
cursor.X > Command1.Left + Me.Left + Command1.Width And cursor.Y > Me.Top + Command1.Top + Command1.Height Then
Exit Do
End If
Loop
StopPlaySound
End Sub
Сейчас этот форум просматривают: Google-бот, Yandex-бот и гости: 5