What is the Alt+Tab order?


What determines the order in which icons appear in the Alt+Tab list?

The icons appear in the same order as the window Z-order. When you switch to a window, then it comes to the top of the Z-order. If you minimize a window, it goes to the bottom of the Z-order. The Alt+Esc hotkey (gosh, does anybody still use Alt+Esc?) takes the current top window and sends it to the bottom of the Z-order (and the window next in line comes to the top). The Alt+Shift+Esc hotkey (I bet you didn't know that hotkey even existed) takes the bottom-most window and brings it to the top, but does not open the window if it is minimized.

The presence of "always on top" windows makes this a little more complicated. The basic rule is that an "always on top" window always appears on top of a "not always on top" window. So if the above rules indicate that a "not always on top" window comes to the top, it really just goes as high as it can without getting on top of any "always on top" windows.

You may have run across the term "fast task switching". This was the term used to describe the precursor to the current Alt+Tab switching interface. The old way of switching via Alt+Tab (Windows 3.0 and earlier) was just like Alt+Esc, except that the window you switched to was automatically opened if it had been minimized. When the new Alt+Tab was added to Windows 3.1, we were concerned that people might prefer the old way, so there was a switch in the control panel to set it back to the slow way. (There is also a setting SPI_SETFASTTASKSWITCH that lets you change it programmatically.) It turns out nobody complained, so the old slow way of task switching was removed entirely and the setting now has no effect.

This does highlight the effort we take to try to allow people who don't like the new way of doing something to go back to the old way. It turns out that corporations with 10,000 employees don't like it when the user interface changes, because it forces them to spend millions of dollars retraining all their employees. If you open up the Group Policy Editor, you can see the zillions of deployment settings that IT administrators can use to disable a variety of new Windows UI features.

Comments (23)
  1. Serge Wautier says:

    Amazing how some supposedly basic things can be so dusted in one’s mind (Mine in this case…)

    Raymond, do you mind if your blog gets cluttered by ‘thanks and keep up with the good work’ comments ;-)

    BTW, what’ the purpose of bringing up a minimized window without opening it ? No, I didn’t the know about Alt+Shift+Esc. I just experimented it. Pretty confusing…

  2. Raymond Chen says:

    Imagine if every window opened as you Alt+Tab’d through it, which is how Alt+Tab used to work. It would be rather annoying if the only way to get to the fifth window was to open all the windows in between. So instead you hit Alt+Escink il you see the one you like, then hit Enter to open it.

  3. Robbin Biesheuvel says:

    Not a comment about this artical, but a question related to the Windows XP Startmenu.
    Why is tho most used application above in the startmenu? It is faster to click on the lowest icon instead of going al the way up with your mouse. In the beginning it would look a little bit strange (a white gab between 2 icons in the list, if the list is not full), but after a while it would be normal for users.

  4. Ian Griffiths says:

    So here’s something that has always perplexed me: when you Alt-Tab, a little pop-up with the various icons in appears. Why can’t I just point and click on the one I want? I can’t believe that this has never occurred to anyone in Microsoft, so there must surely be a good reason why I’m forced to Alt Tab my way through the whole list. (OK, half the list – I not only knew about Alt-Shift-Esc, I know about Alt-Shift-Tab too…)

    (Yes I know I can just use the task bar. But that doesn’t stop me from wanting to be able to point and click at the icons right there in the middle of the screen!)

  5. John Topley says:

    Alt + Tab is a *keyboard* shortcut for switching between windows – why an earth would you want to click on it?!

    I should imagine that the most used application is at the top because conceptually it’s at the top of the pile. It fits the user’s mental model. It also matches file MRU lists in applications, which have the most recently opened file at the top of the list.

  6. Raymond Chen says:

    1. You must admit, it’s pretty weird to list the "most frequently used" programs in reverse order. It’s not like it’s David Letterman’s Top Ten list where he reads them off backwards to build the suspense. Honestly, if we did this, people would be screaming, "What the heck was Microsoft thinking? This is insanity!"

    2. I agree; clicking on the icon in the Alt+Tab list is the sort of thing that "ought to" work. I mentioned this to the author of the Enhanced Alt+Tab PowerToy and I think he added that feature to the powertoy.

  7. saberworks says:

    How come some applications can ignore things like this? For example, when I typ win+m (for minimize all), certain applications don’t minimize. (real rhapsody, for example) It seems like it does it for other keyboard shortcuts as well.

  8. Mike Dimmick says:

    "I mentioned this to the author of the Enhanced Alt+Tab PowerToy and I think he added that feature to the powertoy."

    Yep, he did ;-)

    My only complaint is that it takes a long time to draw the snapshots, but then it _is_ doing a WM_PRINT followed by a resample to an appropriate size (I assume!)

    Is this going into Longhorn, or will it still be a PowerToy (like the ongoing TweakUI, still one of the first programs I install on a new system)?

    Tweak UI features I always have set up: faster menu popup, larger double-click area, mouse scroll by 6 lines, light arrow for shortcuts, no ‘Shortcut to’ prefix, [Tab] to complete filenames and directories.

    I’ve noticed that some applications – particularly VB 6 applications – don’t stay minimized when you use Minimize All (or Show Desktop).

  9. Mike Dunn says:

    A window needs to have a caption and a minimize button for it to be minimized. When you do Logo+M or Logo+D, all windows are hidden (I think?), but as soon as you activate one window, all others that don’t have a minimize button reappear.
    For ex, open an Explorer window and the Display control panel. Hit Logo+D and both will be hidden. If you click Explorer’s taskbar button, the Display dialog comes back too.

    The Group Policy editor seems like a QA nightmare! :o

  10. Shane King says:

    In my opinion, if companies have to spend millions to retrain their employees, it’s because they’ve been poorly trained in the first place.

    It’s along the lines of "give a man a fish and he’ll be fed for a day, teach a man to fish and he’ll be fed for life". Computer training as it stands is pretty much giving a man a fish. People are taught how to do very specific things with very specific applications. What they really should be taught is how to *teach themselves* to use computers in general.

    Of course that probably costs a little more, and companies don’t like spending money on what they consider replacable worker drones. ;)

  11. I think the way Alt-Tab is implemented is great. But the most ineresting thing is that somebody from VS.NET team has implemented such switching style for VS.NET editor tabs! It was pretty unusual when I was started to work with the new IDE, but now I find this VERY useful and comfortable.

  12. "Alt + Tab is a *keyboard* shortcut for switching between windows – why on earth would you want to click on it?!"

    Believe me, I have tried many, many times to click on the Alt+Tab icons, and always been disappointed when it didn’t work. It would be *so* convenient.

    Maybe this will help answer the "why on Earth": For years, I’ve done all my work on IBM ThinkPads. One of the things I like most about these computers is the TrackPoint.

    On my Thinkpad, the mouse is part of the keyboard, and the keyboard is part of the mouse. The usual mouse/keyboard dichotomy just doesn’t exist. With a TrackPoint, it’s perfectly natural to mix and match keyboard and mouse shortcuts.

  13. "Alt + Tab is a *keyboard* shortcut for switching between windows – why on earth would you want to click on it?!"

    Believe me, I have tried many, many times to click on the Alt+Tab icons, and always been disappointed when it didn’t work. It would be *so* convenient.

    Maybe this will help answer the "why on Earth": For years, I’ve done all my work on IBM ThinkPads. One of the things I like most about these computers is the TrackPoint.

    On my Thinkpad, the mouse is part of the keyboard, and the keyboard is part of the mouse. The usual mouse/keyboard dichotomy just doesn’t exist. With a TrackPoint, it’s perfectly natural to mix and match keyboard and mouse shortcuts.

  14. (Sorry about the double post! The blog software threw an exception on the first comment and I didn’t realize it had actually taken it.)

  15. John Topley says:

    I forgot about laptops – excellent point!

    BTW, does the "Remember Me" option for the comments here not work for anyone else?

  16. Charles Oppermann says:

    Related but slightly off-topic. Raymond, do you ever notice that the shell gets confused about "always on top" windows? Oftentimes, I’ll see tooltips from notication area icons appear BEHIND the tray.

    Similarly, sometimes a line of pixels from a maximized window appear in front of the taskbar. In years of watching this occasionally occur, I cannot find any pattern to it. It just appears that Windows and the shell get out of synch on who should be on-top. Does the taskbar occasionally force itself to the top of the z-order? It shouldn’t do that at the expense of tooltips I would imagine.

    Surely others have observed this as well.

  17. Rob M. says:

    I am also the one who cannot live with Alt-Tab. I unconsciously press Alt-Tab quite often.

    Like you guys, I hate to press Alt-Tab repeatedly to each open window. And, I agree with Ian that this kind of application should let users just point and click on icons.

    Anybody know any applications to replace Alt-Tab ways of Microsoft? Thanks.

  18. Rob M. says:

    I’ve got it! I’ve just done a Google search with “alt-tab replacement”. What I’ve found is that there are a few of these applications in market e.g. WinGlance, Windows Exposer. I will try them and let you guys know…

  19. Rob M. says:

    WinGlance works extremely well but Window Exposer seems blurry.

  20. Brad Wilson says:

    John,

    Remember me works fine. You need to have cookies enabled (I think they’re client-side cookies, so you’d also need Javascript enabled).

  21. Eponymous says:

    Has anyone had problems with the Alt-Tab order in XP? When I minimize Outlook 2003, for example, it often doesn’t drop to the bottom of the Z-order. Instead it’ll sit in second place, so minimize, then alt-tab brings up the just-minimized window regardless of how many other windows are in the system. Outlook exhibits this behaviour frequently, other Office apps occasionally, and I’m not sure if non-Office apps have ever done it. I never had such a problem in Win98. Please tell me there’s a workaround.

  22. Raymond Chen says:

    Commenting on this item has been closed.

Comments are closed.

Skip to main content