Windows 3.11 Task Switching and Window Focus
In Microsoft Windows 3.11, switching application focus using keyboard shortcuts relied on a cooperative multitasking architecture governed by the desktop window manager and the Z-order hierarchy. Depending on whether users pressed Alt+Tab, Alt+Esc, or Ctrl+Esc, the operating system utilized specific internal routines—most notably the "CoolSwitch" overlay and sequential Z-order traversal—to route keyboard focus, manipulate window layering, and dispatch standard activation messages to non-preemptive graphical applications.
The Cooperative Architecture and the Z-Order
Windows 3.11 managed interface elements through a strictly ordered
stack of windows known as the Z-order. Because 16-bit Windows operated
on a cooperative multitasking model, all running applications shared a
single system input queue. The operating system tracked which top-level
window possessed the active state and routed all incoming keyboard
messages to that application's message loop via GetMessage
or PeekMessage.
Alt+Tab and the "CoolSwitch" Mechanism
The primary method for task switching in Windows 3.11 was Alt+Tab,
which made use of a feature named "CoolSwitch" (enabled by default via
CoolSwitch=1 in the [boot] section of
SYSTEM.INI).
When a user held down the Alt key and pressed Tab:
- Windows intercepted the keystroke before it reached the currently focused application's message queue.
- Rather than immediately switching active windows, Windows displayed a lightweight, centered modal box that displayed the application's icon and window title.
- Each subsequent press of Tab traversed the system's Z-order from top to bottom, updating the icon and title to represent the next available top-level window.
- When the user finally released the Alt key, Windows dismissed the CoolSwitch box and applied window activation to the chosen target.
If the user targeted a minimized window, Windows did not automatically restore it to its full size; instead, it moved input focus to the icon on the desktop, allowing the user to press Enter or use the System Menu to restore it.
Alt+Esc: Direct Z-Order Cycling
The older, traditional task-switching shortcut in Windows was Alt+Esc. Unlike Alt+Tab, Alt+Esc did not display an on-screen preview.
Upon pressing Alt+Esc:
- The operating system immediately sent the currently active window to the bottom of the Z-order.
- Focus immediately shifted to the next top-level window in line.
- If the next target was minimized, focus moved to its desktop icon, highlighting its title label.
Because focus changed instantly with each press, Alt+Esc forced every intermediate application to process activation messages, making it significantly slower and more resource-intensive than the CoolSwitch Alt+Tab mechanism.
The Ctrl+Esc Task List
Pressing Ctrl+Esc invoked the Windows Task List
(TASKMAN.EXE). This was a standalone system utility that
queried the window manager for all top-level, visible windows and
displayed them in a simple list box. Selecting an entry and pressing
Enter or clicking "Switch To" directed the window manager to alter the
Z-order and transfer focus to that specific program.
Window Activation and Message Dispatching
Once a window was selected through any of these shortcuts, Windows
executed focus management using internal API functions equivalent to
SetActiveWindow and SetWindowPos:
WM_KILLFOCUSandWM_ACTIVATE(Deactivate): The window losing focus received these messages so it could remove cursor carats, alter its title bar color from active to inactive, and suspend interactive processing.- Z-Order Realignment: The chosen target window was
brought to the top of the Z-order (
HWND_TOP). WM_ACTIVATE(Activate) andWM_SETFOCUS: The target window received notification that it was now active. Its title bar repainted to the active system color, and the window assumed control of the keyboard input pipeline.
Because Windows 3.11 lacked preemptive multitasking for 16-bit tasks, this focus handover required the active application to yield control back to the system. If an active application crashed or entered an unyielding loop, task-switching shortcuts would frequently hang until the unresponsive program released control of the shared message loop.