In order to receive the MouseWheel message, I think that the focus should be on a control that receives keyboard input? NOt sure, but in your CAD program the MouseWheel was received for your two popup windows but not for the main MDI window itself.
Here is code that I adapted from the custom code editor that FF3 uses. In this example I am getting the message through the FF_PumpHook rather than dealing with it in every CUSTOM handler for every control. I test for the Windows setting to see what the defined number of lines Windows says that we should scroll, and then I send that many scroll messages to my window/control of choice (in my case it was the FF3 code editor).
Code: Select all
#Define SPI_GETWHEELSCROLLCHARS &H006C
'#Define SPI_GETWHEELSCROLLLINES &H0068
Function FF_PUMPHOOK( uMsg As Msg ) As Integer
' If this function returns FALSE (zero) then the processing of the regular
' FireFly message pump will continue. Returning TRUE (non-zero) will bypass
' the regular message pump.
Function = False ' return TRUE if you need to bypass the FireFly message pump
' Trap the mousewheel for all forms/controls in the application
Select Case uMsg.Message
Case WM_MOUSEWHEEL
Dim nDelta As word
Dim nScrollCount As Integer
Dim y As Integer
nDelta = HiWord(uMsg.wParam)
nScrollCount = 3
If (LoWord(uMsg.wParam) And MK_MBUTTON) = MK_MBUTTON Then
' horizontal scroll
SystemParametersInfo SPI_GETWHEELSCROLLCHARS, 0, nScrollCount, 0
' For y = 1 To nScrollCount
' SendMessage hWnd, WM_HSCROLL, _
' Makelong( IIf(nDelta > 1, SB_LINELEFT, SB_LINERIGHT), 0), _
' 0
' Next
Else
' vertical scroll
SystemParametersInfo SPI_GETWHEELSCROLLLINES, 0, nScrollCount, 0
' DEBUG
MessageBox 0, "Vertical scroll " & nScrollCount & " lines.", "scroll", 0
' For y = 1 To nScrollCount
' SendMessage hWnd, WM_VSCROLL, _
' Makelong( IIf(nDelta > 1, SB_LINEUP, SB_LINEDOWN), 0), _
' 0
' Next
End If
End Select
End Function