Results 1 to 8 of 8

Thread: WM_VSCROLL not picking up scroll wheel?

Threaded View

  1. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: WM_VSCROLL not picking up scroll wheel?

    Quote Originally Posted by i00 View Post
    Can't use WM_MOUSEWHEEL either because this ALSO occurs when the mouse is scroll wheel is actually turned and not after the content is actually scrolled.

    Kris
    OK, I only tried it using a form and just called MyBase.WndProc(m) before checking WM_MOUSEWHEEL...

    Code:
    Public Class Form1
    
        Private Const WM_MOUSEWHEEL As Int32 = &H20A
    
        Private Sub Form1_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
            Debug.WriteLine("Form Wheel = " & e.Delta)
        End Sub
    
        Protected Overrides Sub WndProc(ByRef m As Message)
    	Dim delta As Integer
            MyBase.WndProc(m)
            If m.Msg = WM_MOUSEWHEEL Then
                delta = m.WParam.ToInt32 \ 65536
                Debug.WriteLine("WndProc Wheel =  " & delta)
            End If
        End Sub
    
    End Class
    Last edited by Edgemeal; Jan 2nd, 2012 at 05:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width