To Scroll the Bar with Arrow Keys

Get help with using AutoHotkey and its commands and hotkeys
SorrymyEN
Posts: 13
Joined: 30 Apr 2017, 23:22

To Scroll the Bar with Arrow Keys

19 May 2017, 10:05

I tried and studied AHK exhaustively, but I confess I gave up and ask for help. I would like to position the cursor on the scroll bar with "Left & Down or Up::", pull it down 1 pixel, and return to the original position in Explorer.exe. That's how far I've come ... But I know it's not the right way, since the scroll bar can be in any position y, so the correct thing would be to hold the ClassNN object: ScrollBar2 and adjust the repetition speed.

Code: [Select all] [Download] GeSHi © Codebox Plus

~Left & Down::
MouseGetPos, px, py
Loop, 100
MouseClickDrag, L, 1595, 200, 1595, 201
MouseClickDrag, L, 1595, 202, 1595, 203
MouseClickDrag, L, 1595, 204, 1595, 205
MouseClickDrag, L, 1595, 206, 1595, 207
MouseClickDrag, L, 1595, 208, 1595, 209
Mousemove %px%,%py%, 1
Return

Tnxs in advance
User avatar
jeeswg
Posts: 1513
Joined: 19 Dec 2016, 01:58
Location: UK

Re: To Scroll the Bar with Arrow Keys

19 May 2017, 18:20

This script can scroll down in Explorer, if that's any use to you?

Code: [Select all] [Download] GeSHi © Codebox Plus

;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201

q:: ;Explorer - scroll down (tested on Windows 7)
ControlGet, hCtl, Hwnd,, ScrollBar2, A
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(5)
oAcc := ""
return


Btw another idea would be to get the position for the scrollbar control using ControlGetPos or WinGetPos.
SorrymyEN
Posts: 13
Joined: 30 Apr 2017, 23:22

Re: To Scroll the Bar with Arrow Keys

21 May 2017, 06:05

Thanks for help, Jeeswg, but I get error message in the line oAcc: = Acc_Get (" Object "," 4 ", 0," ahk_id "hCtl).
I have not found what could be "Object" or "ahk_id" in WinTitle, GetControl or SpyWindow.
Am I looking in the wrong way?
User avatar
jeeswg
Posts: 1513
Joined: 19 Dec 2016, 01:58
Location: UK

Re: To Scroll the Bar with Arrow Keys

21 May 2017, 08:00

You may need to install Acc:
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201

If you use AccViewer, the Class(NN) field, and Child ID/Path fields (at the bottom) should give you some of the information you need for Acc_Get.

note:

Code: [Select all] [Download] GeSHi © Codebox Plus

Acc_Get (" Object "," 4 ", 0," ahk_id "hCtl) ;incorrect
Acc_Get("Object", "4", 0, "ahk_id " hCtl) ;correct
SorrymyEN
Posts: 13
Joined: 30 Apr 2017, 23:22

Re: To Scroll the Bar with Arrow Keys

21 May 2017, 11:09

I also tried this (ScrollBar2, ids 3 and 4), but nothing seems to happen on q key, see:
Image
User avatar
jeeswg
Posts: 1513
Joined: 19 Dec 2016, 01:58
Location: UK

Re: To Scroll the Bar with Arrow Keys

22 May 2017, 09:26

- What OS are you using?
- UAC issues (maybe)?
- Is the view in Details/List view, with enough files (and/or a small enough window) to need a scrollbar?
- Maybe it is scrolling but only a tiny bit.
- Have you had any success/partial success using this?
SorrymyEN
Posts: 13
Joined: 30 Apr 2017, 23:22

Re: To Scroll the Bar with Arrow Keys

07 Jun 2017, 09:18

Win7, UAC disabled, thumbnail view, folder with 45 files, nothing moves, no effect.
Thanks for your contribution, but I am a basic knower of AHK and have many similar applications installed that may be interfering.

Return to “Ask For Help”

Who is online

Users browsing this forum: apoklyps3, Bing [Bot], Google [Bot], HotKeyIt, iceivanov and 33 guests