Is it possible to disable most-recently-used ordering of windows' task switching (alt-tab) and use cycling instead? ie., always the same order (no matter how you use, independent of z-order).

I found a workaround with autohotkey called taskbarnavigation by robertcollier4, based on activatebynum.

It's great! Some issues though: it doesn't feature that built-in "icon cycle window" (?) that windows shows when you press Alt+Tab in bare Windows. Also the .ahk script is said not to work in Windows 7. Also, it's performance is not perfect. Furthermore I may not want to activate every single window along the way.

UPDATE: with TaskbarNavigation 1.3, the performance issues can be resolved, thanks to RobertCollier4!

Is there a(n other) way to change task-switching order from MRU to cycle-in-order?

  • An alternative such as this might help. – Karan Jun 18 '13 at 18:00
  • @Karan I'm testing this but cannot actually find an option that disables MRU. Gone through all the preferences window. Are you sure there is one? Could you perhaps help me find it? – n611x007 Jun 18 '13 at 19:40
  • Haven't used it extensively myself. I only briefly tried it long time back, and it occurred to me perhaps it might help you in some way, even if it cannot do what you specifically asked for. – Karan Jun 18 '13 at 19:42
  • @Karan it has nice features, however, there is an, albeit personal, reason I specifically looking for this, which is I have to admit after all these years that MRU irritates me actually. But thanks! :) – n611x007 Jun 18 '13 at 19:45
  • I'll look around for solutions. BTW, does this at least allow Alt+Tab to Desktop in XP? – Karan Jun 18 '13 at 19:46

For Win7, the tool 7+ Taskbar Tweaker can assign a keyboard shortcut to cycle back and forward in visual taskbar order. See the help file under section Advanced>Keyboard Shortcuts. It lets you assign key codes to actions 101 and 102:

101 - Switch to the window which is located on the left to the active window on the taskbar. 
102 - Switch to the window which is located on the right to the active window on the taskbar. 

For Windows XP, which is still a preferred OS to me due to superior responsiveness of UI - TaskbarNavigation seems to be the only currently available solution. There were previously some quirks with Windows not allowing applications to steal focus causing the window to not come to focus but only flash on taskbar. See SetForegroundWindow restrictions problem for which TaskbarNavigation implements some hackish Dllcalls.

However with recent investigation, there may be better methods with SystemParametersInfo(win32con.SPI_SETFOREGROUNDLOCKTIMEOUT or emulating the Alt key before switching or DllCall to RegisterHotKey.

If you want to provide some more feedback on the AutoHotkey forum regarding where performance is to be desired, perhaps it can be improved/fixed/perfected. Adding "#UseHook, Off" may also fix problems.

Cross-linking to related:

| improve this answer | |
  • fantastic program! I can't seem to be able to override alt+tab though. I'm trying it with 0x09|alt, set value (dword, Decimal, 101). it works with other shortcut keys but not with those built-in. – n611x007 Jul 2 '13 at 11:57
  • also 101 and 102 unfortunately also activates the window. I have this same problem with TaskbarNavigation, I don't really want to activate the window, just select it. (In this case similar to win+T in 7, but start from the currently active process, not always from the first.) – n611x007 Jul 2 '13 at 12:00
  • 1
    <<I don't really want to activate the window, just select it.>> Yes, I tried to do this in TaskbarNavigation however was unable to figure it out with the Win Taskbar API Calls (tried all of them such as TB_SETHOTITEM). If anyone has any info, this is a wish of mine as well. – Robert Collier Jul 2 '13 at 12:04
  • 1
    If you still want to do this in Windows XP, you can try TaskbarNavigation v1.3 (new bugfix version just updated and released) which is now mapped to Alt+Tab or Numpad keys instead of Win+arrows. Turns out that Alt modified keys or Numpad keys are considered "special" hotkeys by Windows for which it automatically disables its SetForegroundWindow restrictions. (More info at MSDN LockSetForegroundWindow). Thus if you use one of these special hotkeys it does not require any of the previous DllCall hacks. Therefore switching now works 100% of the time and speed feels like native alt+tab. – Robert Collier Jul 8 '13 at 23:51
  • 1
    I have released TaskbarNavigation 1.4 with a "ListHotkeys Debug" menu entry and a method to make sure that a hotkey will work 100% of the time. If you want to configure your own custom hotkeys, read post #10: autohotkey.com/board/topic/… – Robert Collier Aug 3 '13 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.