Limit (or filter) Alt+Tab windows switcher to show specific windows only

Get help with using AutoHotkey and its commands and hotkeys
omareg94
Posts: 86
Joined: 27 Jun 2016, 22:46

Limit (or filter) Alt+Tab windows switcher to show specific windows only

02 Jun 2020, 08:44

I'm looking for a way to limit (or filter) Alt+Tab windows switcher (screenshot below) to show only windows with specific WinTitle (e.g., ahk_exe notepad.exe).
Is there any idea where to start.

I've come across this blog post: how do I write an Alt+Tab replacement program?

Are there any AHK functions that I can use to make things easier.

Image
mshafer1
Posts: 49
Joined: 16 Jul 2017, 14:49
GitHub: mshafer1
Contact:

Re: Limit (or filter) Alt+Tab windows switcher to show specific windows only

02 Jun 2020, 12:05

With AHK, it's pretty easy to REPLACE the alt-tab behavior with your own, this example looks at the current windows exe, and activates the next window that has the same exe (toggle through Chrome windows for example):

(I normally run it use using alt + backtick (!SC029::), but this should give you an example of what it would look like to change Alt +TAB behavior. As for truly "filtering the displayed list" - you'll need to write your own gui that shows the desired list (AHK has good support for GUIs, as does Python, and many other languages).

Code: Select all

!TAB::
{
 WinGetClass, CLASSVAR, A
 WinGet, PROCESSVAR, ProcessName, A


 group_name := CreateGUID()
 group_name := StrReplace(group_name, "-")
 group_name := Trim(group_name, "{}")

 GroupAdd, %group_name%, ahk_exe %PROCESSVAR%
 GroupActivate, %group_name% ; activate the next one that matches class and exe but not PID
 return
}

; from https://bit.ly/2MIihmb
CreateGUID()
{
 VarSetCapacity(pguid, 16, 0)
 if !(DllCall("ole32.dll\CoCreateGuid", "ptr", &pguid)) {
	size := VarSetCapacity(sguid, (38 << !!A_IsUnicode) + 1, 0)
	if (DllCall("ole32.dll\StringFromGUID2", "ptr", &pguid, "ptr", &sguid, "int", size))
	 return StrGet(&sguid)
 }
 return ""
}
omareg94
Posts: 86
Joined: 27 Jun 2016, 22:46

Re: Limit (or filter) Alt+Tab windows switcher to show specific windows only

02 Jun 2020, 16:14

@mshafer1
That's a good step towards what I'm looking for.

I'm really interested in using the original Windows Switcher because when I hold Win+Alt, I can take a quick glimpse of what windows are open, and I can select window I want to switch to using arrow keys.
I hope there's a way to control the list of windows that the original Windows Switcher shows.
If there's no hope with the original Windows Switcher, I think it's somehow a long way towards developing an alternative GUI with keeping all features.
vsub
Posts: 476
Joined: 29 Sep 2015, 03:39

Re: Limit (or filter) Alt+Tab windows switcher to show specific windows only

03 Jun 2020, 03:34

This is what I was using before on win7 and it can display a preview of all windows on a specific app
https://www.softpedia.com/get/System/OS-Enhancements/BN-Switcher.shtml

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], mikeyww, SimmoF and 33 guests