Windows 10. Make current window move to the end of the alt-tab list

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mikhail22
Posts: 19
Joined: 14 Jan 2018, 11:50

Windows 10. Make current window move to the end of the alt-tab list

14 Nov 2018, 04:42

On Windows 10, how to make current window move to the end of the alt-tab list?
I have tried:

Code: Select all

 WinSet, Bottom ,, A
But this just minimized the window and it is still second top in the Alt-tab list.
I want to move current window to the very bottom of the list.
IIUC the above code worked in the past and it should work for classic alt-tab,
but is there solution for the new Windows 10 desktop?
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: Windows 10. Make current window move to the end of the alt-tab list

15 Nov 2018, 00:57

An ugly solution is to give the window WS_EX_TOOLWINDOW (0x00000080) extended style, so it will not be on the Alt-Tab list at all, then Alt-Tab a few times to update the Alt-Tab list, and restore the window's style at the end.

Code: Select all

; For AHK v2
	hwnd := WinActive("A")
	WinMinimize("ahk_id" hwnd)
	WinSetExStyle(0x00000080, "ahk_id" hwnd)
	loop 4
		Send("{ralt down}{lalt}{tab down}"), Send("{ralt up}{tab up}"), sleep(100)
	WinSetExStyle(-0x00000080, "ahk_id" hwnd)
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Windows 10. Make current window move to the end of the alt-tab list

16 Nov 2018, 15:54

I found it sufficient to simply remove the style and restore it. I used it in this script (for v1).

Code: Select all

        ; Remove the window from the alt-tab list temporarily to force
        ; it to the end of the list.  To do this, temporarily apply the
        ; WS_EX_TOOLWINDOW style and remove WS_EX_APPWINDOW (if present).
        WinGet oldxs, ExStyle, ahk_id %hwnd%
        newxs := (oldxs & ~0x40000) | 0x80
        if (newxs != oldxs)
        {
            WinSet ExStyle, % newxs, ahk_id %hwnd%
            WinSet ExStyle, % oldxs, ahk_id %hwnd%
        }
mikhail22
Posts: 19
Joined: 14 Jan 2018, 11:50

Re: Windows 10. Make current window move to the end of the alt-tab list

10 Dec 2018, 08:35

lexikos wrote:
16 Nov 2018, 15:54
I found it sufficient to simply remove the style and restore it. I used it in this script (for v1).

Code: Select all

        ; Remove the window from the alt-tab list temporarily to force
        ; it to the end of the list.  To do this, temporarily apply the
        ; WS_EX_TOOLWINDOW style and remove WS_EX_APPWINDOW (if present).
        WinGet oldxs, ExStyle, ahk_id %hwnd%
        newxs := (oldxs & ~0x40000) | 0x80
        if (newxs != oldxs)
        {
            WinSet ExStyle, % newxs, ahk_id %hwnd%
            WinSet ExStyle, % oldxs, ahk_id %hwnd%
        }
Hi, I have tried the above snippet, full code :

Code: Select all

^+F1::
	hwnd := WinActive("A")
	WinGet oldxs, ExStyle, ahk_id %hwnd%
	newxs := (oldxs & ~0x40000) | 0x80
	if (newxs != oldxs)
	{
		WinSet ExStyle, % newxs, ahk_id %hwnd%
		WinMinimize ahk_id %hwnd%
		sleep 500
		WinSet ExStyle, % oldxs, ahk_id %hwnd%
	}
	return
It works, but not with all kinds of windows, namely it did not work with for example Skype and Calculator.
Both these apps use new UI, maybe has smthing to do with the type of UI framework used
in the app? I don't know. So for those windows unfortunately nothing happens and ironically Skype was that app
that I wished to apply this trick on most frequently - so I want to look quickly at incoming message and throw it
back to the bottom of lat-tab stack.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 261 guests