How To Lock Scrollbar?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nhanderr
Posts: 9
Joined: 21 Jun 2022, 18:19

How To Lock Scrollbar?

Post by nhanderr » 25 Jun 2022, 09:40

Hi all,

I'm written a script that frequently sends the CTRL + SHIFT + END keys to capture text from the caret to the end of the document. The only issue is that when this happens then the scroll bar briefly jumps to the bottom after which I have to scroll back up. Is there a way to remember/lock the scroll bar position?

Thanks,
Derrick

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: How To Lock Scrollbar?

Post by mikeyww » 25 Jun 2022, 10:51

You can post your script below.

nhanderr
Posts: 9
Joined: 21 Jun 2022, 18:19

Re: How To Lock Scrollbar?

Post by nhanderr » 25 Jun 2022, 22:06

Hi Mikey,

My code is below:

Code: Select all

sendinput ^+{end} ;Essentially the equivalent of hitting the CTRL +SHIFT + END to jump to the end of the document
Sleep 200         ; Wait a bit for the delay  
Clipboard :=      ; Clearing the clipboard
sendinput, ^c     ;Hit the CTRL + C to copy the info
ClipWait,0.1 ;Waiting for info to be copy in the clipboard

Clipvar := Clipboard ;Making a copy of the current clipboard (IE. From the Caret to the end of the document)

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: How To Lock Scrollbar?

Post by mikeyww » 26 Jun 2022, 06:28

I see. I'm not sure, but the following might help or provide something to adapt. https://www.autohotkey.com/board/topic/13625-how-to-get-and-set-vertical-scroll-position/?p=89143

I would also recommend searching the forum for "scrollbar". There may be some additional relevant posts.

Post Reply

Return to “Ask for Help (v1)”