Page 1 of 1

To Scroll the Bar with Arrow Keys

Posted: 19 May 2017, 10:05
by SorrymyEN
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

~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

Re: To Scroll the Bar with Arrow Keys

Posted: 19 May 2017, 18:20
by jeeswg
This script can scroll down in Explorer, if that's any use to you?

Code: Select all

;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.

Re: To Scroll the Bar with Arrow Keys

Posted: 21 May 2017, 06:05
by SorrymyEN
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?

Re: To Scroll the Bar with Arrow Keys

Posted: 21 May 2017, 08:00
by jeeswg
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

Acc_Get (" Object "," 4 ", 0," ahk_id "hCtl) ;incorrect
Acc_Get("Object", "4", 0, "ahk_id " hCtl) ;correct

Re: To Scroll the Bar with Arrow Keys

Posted: 21 May 2017, 11:09
by SorrymyEN
I also tried this (ScrollBar2, ids 3 and 4), but nothing seems to happen on q key, see:
Image

Re: To Scroll the Bar with Arrow Keys

Posted: 22 May 2017, 09:26
by jeeswg
- 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?

Re: To Scroll the Bar with Arrow Keys

Posted: 07 Jun 2017, 09:18
by SorrymyEN
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.