Click here to Skip to main content
15,891,657 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
AnswerRe: FingerPrint scanning Pin
Sebastian Schneider30-Jan-06 1:09
Sebastian Schneider30-Jan-06 1:09 
GeneralRe: FingerPrint scanning Pin
xatkaru31-Jan-06 20:44
xatkaru31-Jan-06 20:44 
Questionsound problems after upgrade to 4 gig of memory Pin
ByStorm Software25-Jan-06 6:39
ByStorm Software25-Jan-06 6:39 
Answerhappened with me Pin
happycpp28-Jan-06 19:24
happycpp28-Jan-06 19:24 
AnswerRe: sound problems after upgrade to 4 gig of memory Pin
Sebastian Schneider30-Jan-06 1:12
Sebastian Schneider30-Jan-06 1:12 
GeneralRe: sound problems after upgrade to 4 gig of memory Pin
ByStorm Software30-Jan-06 4:40
ByStorm Software30-Jan-06 4:40 
QuestionHooking the Mouse Wheel Tilt event Pin
FocusedWolf23-Jan-06 15:52
FocusedWolf23-Jan-06 15:52 
AnswerRe: Hooking the Mouse Wheel Tilt event Pin
progload23-Jan-06 19:08
progload23-Jan-06 19:08 
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_WNDPROC, defWindowProc)
defWindowProc = 0
End If
End Sub

Hope this helps.

progload

-- modified at 1:12 Tuesday 24th January, 2006

Just Another Note: If you still don't see the messages, you'll need to do your own filter driver to do it.

progload
QuestionAccess USB through Matlab Pin
NoobHaxor19-Jan-06 11:13
NoobHaxor19-Jan-06 11:13 
AnswerRe: Access USB through Matlab Pin
Sebastian Schneider22-Jan-06 20:59
Sebastian Schneider22-Jan-06 20:59 
GeneralRe: Access USB through Matlab Pin
Amr M. K.29-Jan-06 7:11
Amr M. K.29-Jan-06 7:11 
QuestionLaptop Suggestions Pin
skyll14-Jan-06 16:01
skyll14-Jan-06 16:01 
AnswerRe: Laptop Suggestions Pin
El Corazon14-Jan-06 17:10
El Corazon14-Jan-06 17:10 
AnswerRe: Laptop Suggestions Pin
skyll15-Jan-06 3:26
skyll15-Jan-06 3:26 
GeneralRe: Laptop Suggestions Pin
DigitalKing15-Jan-06 19:30
DigitalKing15-Jan-06 19:30 
GeneralRe: Laptop Suggestions Pin
Dan Neely16-Jan-06 2:26
Dan Neely16-Jan-06 2:26 
QuestionMedia Center PC Question [Edit] Pin
Mitch F.2-Jan-06 18:39
Mitch F.2-Jan-06 18:39 
QuestionParallel port to UART Pin
subramanian.p30-Dec-05 8:31
subramanian.p30-Dec-05 8:31 
AnswerRe: Parallel port to UART Pin
mercenary013-Jan-06 14:17
mercenary013-Jan-06 14:17 
QuestionTape Drive help required Pin
Touseef Afzal28-Dec-05 22:58
Touseef Afzal28-Dec-05 22:58 
QuestionHow to write a Host application that commuicates with Semiconductor equipment? Pin
Insphere Technology28-Dec-05 19:52
Insphere Technology28-Dec-05 19:52 
AnswerRe: How to write a Host application that commuicates with Semiconductor equipment? Pin
Trollslayer22-Jan-06 5:58
mentorTrollslayer22-Jan-06 5:58 
GeneralRe: How to write a Host application that commuicates with Semiconductor equipment? Pin
Insphere Technology22-Jan-06 14:43
Insphere Technology22-Jan-06 14:43 
AnswerRe: How to write a Host application that commuicates with Semiconductor equipment? Pin
Ryan Binns23-Jan-06 17:19
Ryan Binns23-Jan-06 17:19 
QuestionNeed a quiet system - suggestions wanted Pin
charlieg26-Dec-05 15:29
charlieg26-Dec-05 15:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.