Amed » 13.11.2003 (Чт) 23:20
Option Explicit
Const WM_MOUSEWHEEL = &H20A
Const Mouse_Scroll = &H780000
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Dim mMsg As MSG
Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As MSG, _
ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Function GetNapr()
Dim lMsg As Long
Dim Napr As Long
Call GetMessage(mMsg, Me.hwnd, 0, 0)
lMsg = mMsg.message
Napr = mMsg.wParam
If lMsg = 522 Then
If Napr = Mouse_Scroll Then
Label1.Caption = "Скролл вверх"
ElseIf Napr = -Mouse_Scroll Then
Label1.Caption = "Скролл вниз"
End If
End If
End Function
Private Sub Timer1_Timer()
Call GetNapr
DoEvents
End Sub