Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Hooking the Mouse Wheel Tilt event

Hooking the Mouse Wheel Tilt event

Scheduled Pinned Locked Moved Hardware & Devices
algorithms
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FocusedWolf
    wrote on last edited by
    #1

    I've been searching for a way to do this and so far all efforts have failed :P When i set a global mouse hook, no event is detected when i press a mouse tilt...just wondering if anyone has any suggestions. I dont even think its possible to set a key to its action in microsoft's intellipoint software...thats the reason i'm doing this...i want to bind those keys.

    P 1 Reply Last reply
    0
    • F FocusedWolf

      I've been searching for a way to do this and so far all efforts have failed :P When i set a global mouse hook, no event is detected when i press a mouse tilt...just wondering if anyone has any suggestions. I dont even think its possible to set a key to its action in microsoft's intellipoint software...thats the reason i'm doing this...i want to bind those keys.

      P Offline
      P Offline
      progload
      wrote on last edited by
      #2

      check the new WM_APPCOMMAND messages http://www.microsoft.com/whdc/device/input/5b\_wheel.mspx "However, buttons 4 and 5 are not mapped to any specific User32 or Shell functionality; instead these buttons can be mapped by software applications to application-specific functionality. More specifically, these buttons are mapped to new WM_APPCOMMAND messages that are in Windows to notify software applications of application command events." Somthing like this: Public defWindowProc As Long Public Const GWL_WNDPROC As Long = (-4) Const WM_APPCOMMAND As Long = &H319 Const XBUTTON1 = &H80010000 Const XBUTTON2 = &H80020000 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 Private 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 Function WindowProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 'Subclass form to trap messages On Error Resume Next Dim retVal As Long 'First let the original Window Procedure process the message. 'CallWindowProc returns the part of the form the mouse is on. retVal = CallWindowProc(defWindowProc, hwnd, Msg, wParam, lParam) 'What message received? If Msg = WM_APPCOMMAND Then If lParam = XBUTTON1 Then Form1.Print "XButton 1 clicked" ElseIf lParam = XBUTTON2 Then Form1.Print "XButton 2 clicked" End If End If WindowProc = retVal End Function Private Sub Form_Load() 'Begin the subclassing of frmMain by passing the 'address of our new Window Procedure. SetWindowLong 'returns the address of the original Window Procedure, 'so we store it in a global variable to restore 'when stopping the subclassing (typically, in the 'Unload event). defWindowProc = SetWindowLong(Form1.hwnd, GWL_WNDPROC, AddressOf WindowProc) End Sub Private Sub Form_Unload(Cancel As Integer) 'restore the original Window Procedure 'before unloading the form, or GPF will occur If defWindowProc Then Call SetWindowLong(Form1.hwnd, GWL_

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups