Jump to content
Coler

Trying to use second mouse as scrolling tool

Recommended Posts

Coler

Hi all, what wonderful tool Autoit!
Unfortunately i'm completely new to this program, I'm trying to get into it but I need some help.
I have to convert any mouse movement to WM_VSCROLL and WM_HSCROLL messages, 1 (or more) line for pixel mouse movement, and preferably on any window the mouse pointer is on, even if not active, (not minimized but just in background), these are almost my needs,
Any help will be much appreciated

Thank you very much.

Share this post


Link to post
Share on other sites
Coler

mh, at least if anybody could help me replicating these SendMessages captured with Winspector.. Variables seems to be not like LINEUP etc, but THUMBTRACK and THUMBPOSITION..  I tried to follow some ready Scripts and beginning tutorials but I think here is a bit more complicated :( .

I think CTLCOLORSCROLLBAR could be ignored, sorry but Winspector just saves the entire capture even with the filter.
 

Spoiler

<message>
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>wParam: 0x03010a8f</parameter>
            <parameter>lParam: 0x00030486</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Return: 0x00000000</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Request: SB_THUMBTRACK</parameter>
            <parameter>Position: 568</parameter>
            <parameter>Scrollbar Handle: 00030486</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>wParam: 0x03010a8f</parameter>
            <parameter>lParam: 0x00030486</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Return: 0x00000000</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>wParam: 0x03010a8f</parameter>
            <parameter>lParam: 0x00030486</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <parameters>
        <time>09:48:27.0390</time>
            <parameter>Return: 0x00000000</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>wParam: 0x0c010489</parameter>
            <parameter>lParam: 0x0002048a</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_CTLCOLORSCROLLBAR</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Return: 0x00000000</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Processed: False</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Request: SB_THUMBPOSITION</parameter>
            <parameter>Position: 568</parameter>
            <parameter>Scrollbar Handle: 00030486</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Processed: False</parameter>
        </parameters>
    </message>
    <message>
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Request: SB_ENDSCROLL</parameter>
            <parameter>Position: 0</parameter>
            <parameter>Scrollbar Handle: 00030486</parameter>
        </parameters>
    </message>
    <message return-value="1">
        <name>WM_HSCROLL</name>
        <sent />
        <time>09:48:27.0390</time>
        <parameters>
            <parameter>Processed: False</parameter>
        </parameters>
    </message>

Thank you

Very at least, I could donate, eh, for a complete working script.
for the moment I just want to test single inputs to see if the work page is scrolling appropriately.. LINEUP etc seem not working, plus the window I want to scroll is a subwindow class,


 

Share this post


Link to post
Share on other sites
Jfish

Hello and welcome.  I think you will find that people are willing to help if you post what you have done so far and where you are stuck specifically (assuming your script does not violate forum rules).   Members don't usually write up solutions or complete working scripts if the OP didn't at least try first and show their work.  If you decide to do that I would also recommend using the code tags <> in the editor.


Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Share this post


Link to post
Share on other sites
Coler
Posted (edited)

Thanks for reply and explanation. Yep I see, well I didn't post anything because I'm already stuck in the very first line, and I don't think it violates forum rules since I Just have to pan a page where I work on :)

Hope not bothering you guys, having to discuss with a beginner newbie ,

Here is what I tried on notepad window for testing:

 

#include <SendMessage.au3>
$hWnd = ControlGetHandle('[CLASS:Notepad]', '', 'Edit1')
$iMsg = 115  ; WM_VSCROLL
$wParam = "SB_THUMBPOSITION" ; or number?
$lParam = 33 ; position from top?
_SendMessage ( $hWnd, $IMsg , [$wParam , [$lParam ]]) ;  gives me sintax error lol



 

Edited by Coler

Share this post


Link to post
Share on other sites
Jos

Here is an example of doing vertical scrolling actions on notepad to get you started:

#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <ScrollBarsConstants.au3>
$hWnd = ControlGetHandle('[CLASS:Notepad]', '', 'Edit1')
WinActivate($hWnd)

; go to the top of the file
$iMsg = $WM_VSCROLL
$wParam = $SB_TOP
$lParam = 0
_SendMessage ( $hWnd, $IMsg , $wParam , $lParam )

Sleep(2000)
; go to the bottom of the file
$iMsg = $WM_VSCROLL
$wParam = $SB_BOTTOM
$lParam = 0
_SendMessage ( $hWnd, $IMsg , $wParam , $lParam )

Sleep(2000)
; go one page up
$iMsg = $WM_VSCROLL
$wParam = $SB_PAGEUP
$lParam = 0
_SendMessage ( $hWnd, $IMsg , $wParam , $lParam )

Sleep(2000)
; go one page up
$iMsg = $WM_VSCROLL
$wParam = $SB_PAGEUP
$lParam = 0
_SendMessage ( $hWnd, $IMsg , $wParam , $lParam )

 

The $SB_THUMBPOSITION message is send when the mouse button is release so don't think that is what you are looking for.
Check here for details: https://msdn.microsoft.com/en-us/library/bb787577(VS.85).aspx

Jos

 

 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Coler
Posted (edited)

Thanks for your time, I started from that!

For the moment I see that is working on notepad but unfortunately not on this program I use, (same as ThumbPosition/Track even if is not responding to my wishes but at least is moving on NotePad).

I saw there are exclusive window classes of the scrollbars, "TScrollBar1" horizontal, "TScrollBar2" vertical, so I could try to send messages on them for trying to drag the little rectangle, should same commands still work or they need other values? They don't seem to move yet... 

Thank you for your support.

Edited by Coler

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×