|
'不难.....
'模块1改为:
Option Explicit
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const GWL_WNDPROC = -4&
Public Const WM_MOUSEWHEEL = &H20A
Public OldWindowProc As Long
Public hwnd As Long
Public Function lsftest(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
On Error Resume Next
If Msg = WM_MOUSEWHEEL Then
If wParam = -7864320 Then
UserForm1.Scroll fmScrollActionNoChange, fmScrollActionLineDown
ElseIf wParam = 7864320 Then
UserForm1.Scroll fmScrollActionNoChange, fmScrollActionLineUp
End If
Else
lsftest = CallWindowProc(OldWindowProc, hwnd, Msg, wParam, lParam)
End If
End Function
Sub Show()
UserForm1.Show
End Sub |
|