the code below works only when the form is focus/active.
can someone help me how to fix it to work when the form is not focus?

sub form_load
OldProc1 = GetWindowLong(Me.hWnd, GWL_WNDPROC)
SetWindowLong Me.hWnd, GWL_WNDPROC, AddressOf TWndProc1
end if

'in module
Public Function TWndProc1(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

If wMsg = WM_MOUSEWHEEL Then ' Have we got a mouse wheel message

If wParam > 0 Then MouseWheelUp = True Else MouseWheelUp = False

If MouseWheelUp Then
i = i + 1 ' update our counter
i = i - 1 ' update our counter
End If
Form1.Label1.Caption = "The value of the mouse wheel is " & i ' update the text in the textbox
End If
TWndProc1 = CallWindowProc(OldProc1, hWnd, wMsg, wParam, lParam)

End Function