What's the issue? Which code did you try?
(Hint: When you create a post, there is an edit field for your actual post and the detailed description of your problem. You could even add the code you have tried - between code tags, please. This will help your helpers to help you.)
But a guess: a permissions issue because Task Manager and other system windows run with elevated rights -> https://www.autohotkey.com/docs/v1/FAQ.htm#uac
Scroll through open windows issue when Task Manager or Services.msc windows active
Scroll through open windows issue when Task Manager, Services.msc or any other system console windows active
This is not my script, i copied and modified hotkeys for my use.It's working as intented but when I open Task Manager, it's scrolling only forward but not backwards. When I open Services.msc or any other system console windows, it stops working completely even minimized state.But If I minimize Task Manager, it works again.I'm not talking about opening Task Manager and Services.msc at the same time.I tried them individually.
Windows 10 22H2
Can anyone help me? Thanks in advance.
Windows 10 22H2
Can anyone help me? Thanks in advance.
Code: Select all
~RButton & MButton::
Send +{Click Right} ; Shift+RightClick
return
~LButton & WheelUp:: ; Move bottom window to top
~LButton & WheelDown:: ; Move top window to bottom
win := []
WinGet, wins, List
Loop, %wins% {
WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index%
WinGet, proc, ProcessName, %winTitle%
WinGet, state, MinMax, %winTitle%
SplitPath, proc,,,, proc
WinGetClass, class, %winTitle%
If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer") && class != "#32770" && state != -1)
If proc not in Rainmeter
win.Push(wins%A_Index%)
}
If (A_ThisHotkey = "~LButton & WheelDown") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
Last edited by gregster on 17 May 2024, 16:04, edited 1 time in total.
Reason: Merged duplicate topics.
Reason: Merged duplicate topics.
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
Your script needs elevated rights when an elevated window is active. If you follow the link above, you'll find a few options.gregster wrote: ↑17 May 2024, 15:38But a guess: a permissions issue because Task Manager and other system windows run with elevated rights -> https://www.autohotkey.com/docs/v1/FAQ.htm#uac
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
Thank you for your answer.gregster wrote: ↑17 May 2024, 16:15Your script needs elevated rights when an elevated window is active. If you follow the link above, you'll find a few options.gregster wrote: ↑17 May 2024, 15:38But a guess: a permissions issue because Task Manager and other system windows run with elevated rights -> https://www.autohotkey.com/docs/v1/FAQ.htm#uac
I checked if script and autohotkey was running in elevated state.Even if it is elevated, same problem occures.
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
Can't reproduce it (on WIn11). With admin rights, the script works as expected, afaics - even with elevated windows.
Perhaps you need to describe in more detail what you do, what happens and what you want to happen instead.
Perhaps you need to describe in more detail what you do, what happens and what you want to happen instead.
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
I have intalled autohotkey v2 on top of v1.
In autohotkey folder, there are two version intances of v1 and v2.
v1.1.36.02, v2 and v2.0.2 AutoHotkeyUX version 2.0.11.0
I wonder if it is related.
In autohotkey folder, there are two version intances of v1 and v2.
v1.1.36.02, v2 and v2.0.2 AutoHotkeyUX version 2.0.11.0
I wonder if it is related.
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
Don't think so, v1 and v2 can live happily together. Your script is v1 - it wouldn't run on v2 and v2 isn't involved in executing it. I have both installed (latest versions v1.1.37.02 and v2.0.15).
Just to be sure, what does this msgbox say, if you add it to the top of the script?
Just to be sure, what does this msgbox say, if you add it to the top of the script?
Code: Select all
msgbox % A_IsAdmin
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
msgbox says 1
FYI; This script works on my system in any condition without problem, even if it is not elevated.
FYI; This script works on my system in any condition without problem, even if it is not elevated.
Code: Select all
~RButton & WheelDown::Windows(-1) ; Switching between windows of the same application
~RButton & WheelUp::Windows(+1) ; Switching between windows of the same application
Windows(Direction)
{
static total, hWnds, last := ""
a := WinExist("A")
WinGetClass wClass
WinGet exe, ProcessName
if (exe != last) {
last := exe
hWnds := []
DetectHiddenWindows Off
WinGet wList, List, % "ahk_exe" exe " ahk_class" wClass
loop % wList {
hWnd := wList%A_Index%
hWnds.Push(hWnd)
}
total := hWnds.Count()
}
for i,hWnd in hWnds {
if (a = hWnd)
break
}
i += Direction
; i := Max(1, Min(total, i))
i := i > total ? 1 : i = 0 ? total : i
WinActivate % "ahk_id" hWnds[i]
}
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
Maybe it is a specific problem only for my system.I don't know.
Re: Scroll through open windows issue when Task Manager or Services.msc windows active
If I remember correctly the task manager runs at a different permission level. You might try running your script as administrator as a quick test
Who is online
Users browsing this forum: GoneFishing, Google [Bot], just_abs, mikeyww, Pianist and 179 guests