[How To] Scroll listbox, listview and edit controls

Helpful script writing tricks and HowTo's
User avatar
tidbit
Posts: 1088
Joined: 29 Sep 2013, 17:15
Location: USA

[How To] Scroll listbox, listview and edit controls

16 Nov 2013, 19:36

... and probably any edit control with a scrollbar.
Note: since this is sendmessage, it'll work on most windows, not just AHK GUI's.

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus



Some more technical info (Thanks Blackholyman!)
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787577(v=vs.85).aspx
WM_VSCROLL = &H115
Public Enum WM_HSCROLL_low As Short
SB_ENDSCROLL = 8
SB_LEFT = 6
SB_RIGHT = 7
SB_LINELEFT = 0
SB_LINERIGHT = 1
SB_PAGELEFT = 2
SB_PAGERIGHT = 3
SB_THUMBPOSITION = 4
SB_THUMBTRACK = 5
End Enum
Public Enum WM_VSCROLL_low As Short
SB_BOTTOM = 7
SB_ENDSCROLL = WM_HSCROLL_low.SB_ENDSCROLL
SB_LINEDOWN = 1
SB_LINEUP = 0
SB_PAGEDOWN = 3
SB_PAGEUP = 2
SB_THUMBPOSITION = WM_HSCROLL_low.SB_THUMBPOSITION
SB_THUMBTRACK = WM_HSCROLL_low.SB_THUMBTRACK
SB_TOP = 6
End Enum
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
Sjc1000
Posts: 39
Joined: 02 Oct 2013, 02:07

Re: [How To] Scroll listbox, listview and edit controls

17 Nov 2013, 02:38

Nice trick. I also saw this from you on IRC, though i did not fully try it out. Good job. Totally bookmarked this page. :D
Please find me on the IRC if you have any questions, I'm never on the forum anymore.
User avatar
paulrrogers
Posts: 5
Joined: 23 Oct 2014, 15:05
Facebook: paulryanrogers
Contact:

Re: [How To] Scroll listbox, listview and edit controls

17 Nov 2014, 14:14

Any way to make this work with Java swing GUIs such as J-edit?
PaulRRogers.com
User avatar
tidbit
Posts: 1088
Joined: 29 Sep 2013, 17:15
Location: USA

Re: [How To] Scroll listbox, listview and edit controls

17 Nov 2014, 15:11

I have absolutely no idea.
Though, Java GUI's are known to be extremely stubborn and hard to get working with AHK, due to the non-standard controls (thus, they don't really listen to standard events Windows has setup)
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
Guest

Re: [How To] Scroll listbox, listview and edit controls

21 Nov 2014, 13:37

Understood. Thanks for taking the time to share it regardless.

FWIW, also seems that scrolling to top and bottom within an IE page does not recognize these commands.

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests