-
Hi all, sorry I was away for a while, it's because my pc crashed, but now it's fixed and even improved :)
Well, here is my question:
I want to do that when ever a user middle-clicks in the mouse, it will launch my app. My app will have several command buttons.
2 for both scrollbars in the active window (not my app, something like IE).
For those who don't know what I mean, check Logitech's new feature in their mouse drivers.
A command button for pop-uping the menus in the active window etc.
How do I control the active window's scrollbars and how can I pop my app whenever a middle-click is made?
ThanX for any help.
-
To scroll a Window: use WindowFromPoint to get the Window the mouse is over and use ScrollWindowEx to scroll the window.
To make an App Pop-up when the middle button is pressed, use GetAsyncKeyState.
Add the following to a Form with a Timer.
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbMiddleButton) Then Shell "MyApp.exe", 1
End Sub
-
Very big thanX Megatron, but how do I scroll another window?