Cycle through windows of all open applications Topic is solved
-
- Posts: 24
- Joined: 04 Jul 2021, 01:15
Cycle through windows of all open applications
there are a couple of keyboard shortcuts tht allows you to do this
alt+tab and win+tab opens up the task view like page from where you can select the desired window
alt+esc lets you cycle through all the open windows..but this ignores minimized windows
i want to able to cycle through windows irrespective of whether window is minimized or in the background without bringing up the task view page when i use mouse wheel up or down preferably in the last used order..so its a weird combination of both...it wud be great if somebody can guide me on this..maybe i am overlooking some other keyboard shortcut??
any help wud be great
PS: wud it be possible to activate the script only if mouse wheel is scrolled when mouse is at any corner of the screen???
alt+tab and win+tab opens up the task view like page from where you can select the desired window
alt+esc lets you cycle through all the open windows..but this ignores minimized windows
i want to able to cycle through windows irrespective of whether window is minimized or in the background without bringing up the task view page when i use mouse wheel up or down preferably in the last used order..so its a weird combination of both...it wud be great if somebody can guide me on this..maybe i am overlooking some other keyboard shortcut??
any help wud be great
PS: wud it be possible to activate the script only if mouse wheel is scrolled when mouse is at any corner of the screen???
Re: Cycle through windows of all open applications
Here is a demonstration that you can adapt.
Code: Select all
F3::
win := windows()
WinActivate, % "ahk_id " win[win.Count()]
Return
windows() {
program := []
WinGet, wins, List
Loop, %wins% {
WinGet, style, Style, % "ahk_id " wins%A_Index%
If !(style ~= "0x(9|16)")
program.Push(wins%A_Index%)
}
Return program
}
-
- Posts: 24
- Joined: 04 Jul 2021, 01:15
Re: Cycle through windows of all open applications
thank you..would it be possible to cycle through it in the reverse order also??
Re: Cycle through windows of all open applications
Code: Select all
F3:: ; Move bottom window to top
F4:: ; Move top window to bottom
win := []
WinGet, wins, List
Loop, %wins% {
WinGet, style, Style, % "ahk_id " wins%A_Index%
If !(style ~= "0x(9|16)")
win.Push(wins%A_Index%)
}
If (A_ThisHotkey = "F4") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
-
- Posts: 24
- Joined: 04 Jul 2021, 01:15
Re: Cycle through windows of all open applications
i tried the above script with 4 windows open...after cycling through all the tabs once only 2 windows got cycled through in the next cycle...if i restart the script again it cycles through all the tabs in the first cycle but if you try to continue to cycle again only 2 of the 4 gets cycled..is this some kind of issue with matching the window title or somethig??
Re: Cycle through windows of all open applications
It worked here, but you may need to adjust it to see which windows are matching at your end, etc. You might have windows in the array that should not be there. The version below will display the window titles.
Code: Select all
F3:: ; Move bottom window to top
F4:: ; Move top window to bottom
win := [], list := ""
WinGet, wins, List
Loop, %wins% {
WinGet, style, Style, % winTitle := "ahk_id " wins%A_Index%
If (style ~= "0x(9|16)")
Continue
WinGetTitle, ttitle, %winTitle%
win.Push(wins%A_Index%), list .= (list ? "`n`n" : "") ttitle
}
MsgBox, 64, % "Window list (N=" win.Count() ")", %list%
If (A_ThisHotkey = "F4") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
-
- Posts: 24
- Joined: 04 Jul 2021, 01:15
Re: Cycle through windows of all open applications
thank you for the script showing all the window names...i am not sure wht the issue is..maybe its some bug in collecting window names..ill try to explain wht happened in my case..i had 5 windows open brave browser, notepad++,file explorer, internet download manager, potplayer..
the first time the script is run all the five windows were listed...as i cycle through it and reach internet download manager, internet download manager alone gets removed from the list...again as i cycle through it and reach potplayer it also gets removed...currently i am facing the issue onl with idm and potplayer..
also if 2 or more windows of same application is open it only shows 1 window only per application
the first time the script is run all the five windows were listed...as i cycle through it and reach internet download manager, internet download manager alone gets removed from the list...again as i cycle through it and reach potplayer it also gets removed...currently i am facing the issue onl with idm and potplayer..
also if 2 or more windows of same application is open it only shows 1 window only per application
Re: Cycle through windows of all open applications
An update is below.
Code: Select all
F3:: ; Move bottom window to top
F4:: ; Move top window to bottom
win := []
WinGet, wins, List
Loop, %wins% {
WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index%
WinGet, proc, ProcessName, %winTitle%
WinGetClass, class, %winTitle%
If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer.EXE") && class != "#32770")
win.Push(wins%A_Index%)
}
If (A_ThisHotkey = "F4") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
-
- Posts: 24
- Joined: 04 Jul 2021, 01:15
Re: Cycle through windows of all open applications
is there an alternative way to get window titles??the code posted above cycles through lot of stuff including rainmeter skins tht i have on desktop..
i apologize for all the hassle
i apologize for all the hassle
Re: Cycle through windows of all open applications
You can add to line 10-11, to eliminate what you do not need.
Code: Select all
F3:: ; Move bottom window to top
F4:: ; Move top window to bottom
win := []
WinGet, wins, List
Loop, %wins% {
WinGetTitle, ttitle, % winTitle := "ahk_id " wins%A_Index%
WinGet, proc, ProcessName, %winTitle%
SplitPath, proc,,,, proc
WinGetClass, class, %winTitle%
If (ttitle > "" && (ttitle != "Program Manager" || proc != "Explorer") && class != "#32770")
If proc not in Rainmeter
win.Push(wins%A_Index%)
}
If (A_ThisHotkey = "F4") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Cycle through windows of all open applications
Is there a way to modify this code to cycle through non-minimized windows? This maximize all windows.mikeyww wrote: ↑26 Nov 2021, 15:55Here is a demonstration that you can adapt.
Code: Select all
F3:: win := windows() WinActivate, % "ahk_id " win[win.Count()] Return windows() { program := [] WinGet, wins, List Loop, %wins% { WinGet, style, Style, % "ahk_id " wins%A_Index% If !(style ~= "0x(9|16)") program.Push(wins%A_Index%) } Return program }
Re: Cycle through windows of all open applications
Here is a way to identify min-max state. https://www.autohotkey.com/docs/commands/WinGet.htm#MinMax
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Cycle through windows of all open applications
Thank you but I know that part, the issue is that I am not sure where to put an "if" in that code as it is not understandable for me, I am not that knowledgeable in ahk yetmikeyww wrote: ↑17 Jun 2022, 10:47Here is a way to identify min-max state. https://www.autohotkey.com/docs/commands/WinGet.htm#MinMax
Re: Cycle through windows of all open applications
Code: Select all
F3:: ; Move bottom window to top
F4:: ; 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 = "F4") {
WinSet, Bottom, , % "ahk_id " win.1
WinActivate , % "ahk_id " win.2
} Else WinActivate, % "ahk_id " win[win.Count()]
Return
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Cycle through windows of all open applications Topic is solved
thank you very muchmikeyww wrote: ↑18 Jun 2022, 05:42Code: Select all
F3:: ; Move bottom window to top F4:: ; 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 = "F4") { WinSet, Bottom, , % "ahk_id " win.1 WinActivate , % "ahk_id " win.2 } Else WinActivate, % "ahk_id " win[win.Count()] Return