Scroll window on top
Scroll window on top
Have looked but see nothing so I will ask. Let's say I have my browser open Fullscreen and open my task manager which is not full screen. Is it possible with ahk to scroll task manager window without having to move cursor to task manager window. IE. Just scroll the open window on top.
Re: Scroll window on top
Hallo,
try:
try:
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
q::ControlClick,, ahk_exe Taskmgr.exe,, WheelUp
w::ControlClick,, ahk_exe Taskmgr.exe,, WheelDown
Re: Scroll window on top
Thank you. Will try when I get home.
Re: Scroll window on top
@rohwedder. Question. Haven't tried your script yet but am I safe in assuming that it would only scroll an open task manager on top window? If so is it possible to scroll any open random window on top the same way except remove the task manager. Exe from the script? Tk's
Re: Scroll window on top
Try changing it to this to have it act on the active window even if the mouse pointer is above another window:
You could even still use your mouse wheel instead of different keys. It just acts on the active window instead of what's under the mouse:
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
q::ControlClick,, A,, WheelUp
w::ControlClick,, A,, WheelDown
You could even still use your mouse wheel instead of different keys. It just acts on the active window instead of what's under the mouse:
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
WheelUp::ControlClick,, A,, WheelUp
WheelDown::ControlClick,, A,, WheelDown
Re: Scroll window on top
@boiler. Thank you. Will have a look at this and get back to you. Cheer's
Re: Scroll window on top
Sure. If you want, you can add a hotkey to toggle the mouse wheel between active window and mouse over. The following will allow you to use Ctrl+Tab to toggle between the two modes:
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
WheelUp::ControlClick,, A,, WheelUp
WheelDown::ControlClick,, A,, WheelDown
^Tab::Suspend
Re: Scroll window on top
Hi guys . I'm back. This might not be possible. Just realized I have other stuff attached. I tried both codes rohwedder and boiler's. But both came up in line 3 as no application associated Here is my current Mouse script
Code: Select all
#SingleInstance, Force
#KeyHistory
#Persistent
;#Warn
^WheelUp:: VKAF ;Zoom Key+(Volume Control Up)
Return
^WheelDown:: VKAE ;Zoom Key-(Volume Control Down)
Return
WheelLeft::
Return
WheelRight::
Return
MButton::Run, E:\PortableApps\PortableApps\AutoHotkeyPortable\AHK Scripts\Firefox\Firefox Bookmark's.ahk ;Open Firefox Bookmark's
Return
#If MouseIsOver("ahk_class Shell_TrayWnd") ;Raise or lower volume when arrow over taskbar
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}
#If
MouseIsOver(WinTitle)
{ MouseGetPos,,, Win
Return WinExist(WinTitle . " ahk_id " . Win)
}
Return
Re: Scroll window on top
Do you have AHK installed such that .ahk files are associated with it? Can you double-click on a script in File Explorer to have it run?
Re: Scroll window on top
I can click on any of my scripts which are located in my ahk folder and they work fine. Strange thing is this error comes up but then script shows up in my window tray. what doesn't work like I wantis if my browser is open fullscreen and IE I open file explorer I still have to move cursor over Explorer window for it to scroll. Oh well. Not the end of the world. It is windows 11.
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
WheelUp::ControlClick,, A,, WheelUp
WheelDown::ControlClick,, A,, WheelDown
Re: Scroll window on top
I'm finding that FileExplorer doesn't seem to respond to the ControlClick, as is true for many applications. It works for me if I try it with Chrome and another program's window like Notepad or VS Code.
Re: Scroll window on top
@boiler. As i said no big deal. Just a thought. Not something I would use that much but was interested to see if it was possible. It also could be something in this new Windows 11. Tk's for trying. Cheer's
Re: Scroll window on top
Sure. Maybe Rohwedder or someone else knows a way to get File Explorer to respond or to accomplish this in some other way.
Re: Scroll window on top
I'm curious, though. What error comes up? It's not just asking if you want to "allow this app from an unknown publisher to make changes to your device?"
Re: Scroll window on top
@boiler. Word for word And then when I close it. the hotkey icon showing scroll.ahk is there but when I have firefox open and open task manager it won't scroll task manager and then I have to double click to get my firefox to scroll again. But there is also the issue of my using the wheel in the taskbar to control volume. Not sure how much of a difference that would make turning it off.
---------------------------
Scroll.ahk
---------------------------
Error: Failed attempt to launch program or document:
Action: <C:\Users\Jr\Desktop\Scroll.ahk>
Verb: <RunAs>
Params: <>
Specifically: No application is associated with the specified file for this operation.
Line#
002: if !A_IsAdmin
---> 003: Run,*RunAs "%A_ScriptFullPath%"
004: Return
004: ControlClick,,A,,WheelUp
004: Return
005: ControlClick,,A,,WheelDown
005: Return
006: Exit
007: Exit
The current thread will exit.
---------------------------
OK
---------------------------
---------------------------
Scroll.ahk
---------------------------
Error: Failed attempt to launch program or document:
Action: <C:\Users\Jr\Desktop\Scroll.ahk>
Verb: <RunAs>
Params: <>
Specifically: No application is associated with the specified file for this operation.
Line#
002: if !A_IsAdmin
---> 003: Run,*RunAs "%A_ScriptFullPath%"
004: Return
004: ControlClick,,A,,WheelUp
004: Return
005: ControlClick,,A,,WheelDown
005: Return
006: Exit
007: Exit
The current thread will exit.
---------------------------
OK
---------------------------
Re: Scroll window on top
Weird. I don’t know what would cause that if your system knows what .ahk files are.
Re: Scroll window on top
@rohwedder. Haven't heard from you. Any thoughts? Lol. Or is that why I haven't heard any more input from you. All I want is the ability to not have to move the cursor and be able to scroll the open window on top whatever it happens to be. Task manager, explorer, notepad, etc. Just to save the half second. I am more curious about if it is possible. Or does the cursor have to be in the active window to scroll?
Re: Scroll window on top
As I mentioned, it works with some programs, and not others. It works for me with all the apps you mentioned and more except File Explorer. Did you try it with those?jrachr wrote: ↑ All I want is the ability to not have to move the cursor and be able to scroll the open window on top whatever it happens to be. Task manager, explorer, notepad, etc. Just to save the half second. I am more curious about if it is possible. Or does the cursor have to be in the active window to scroll?
You can still have it work for all windows where it is capable, and you can even have it show a ToolTip reminder for when the active window requires the mouse to be over it and have it work the normal way once the mouse is over it, like with this script (current exception that it works with is File Explorer but could be made to work with others as well):
Code: Select all
#SingleInstance, Force
If !A_IsAdmin
Run *RunAs "%A_ScriptFullPath%"
#If WinActive("ahk_class CabinetWClass")
$WheelUp::
$WheelDown::
if MouseIsOver("ahk_class CabinetWClass") {
ToolTip
Send, % "{" SubStr(A_ThisHotkey, 2) "}"
} else {
ToolTip, Mouse must be over the current active window to scroll it
SetTimer, ToolTipOff, -1000
}
return
#If
WheelUp::ControlClick,, A,, WheelUp
WheelDown::ControlClick,, A,, WheelDown
ToolTipOff:
ToolTip
return
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
Re: Scroll window on top
Will play around and see what happens. Tk's boiler. Cheer's