Note: This example is only applicable to computers running Windows XP. After opening the example and opening two or more application windows, use the AltTab function key to run the TaskSwitcher application.
Abstract: This article introduces an enhanced AltTab application TaskSwitcher, and uses this framework to demonstrate the new appearance style and PrintWindow method of Windows XP in Windows applications.
Directory
Introduction
TaskSwitcher Application
Intercept keyboard input
Enumeration top-layer application window
Display top-level application window
Use Comctl32.dll 6
Summary
Introduction
Microsoft®Windows®XP introduces a new appearance style, which is easy to use and has richer user interfaces. For example, you can achieve hot tracking of UI elements when hovering the corner window, more textured taskbar, and over the UI element.
Figure 1: Calculator and Display Properties dialog boxes in the new style
Windows XP also introduces a new printing API: PrintWindow ). This API allows the caller to create a window snapshot and insert it into the device environment.
For more information about the appearance style and its application, see the Technical article "use Windows XP appearance style" in the MSDN Library ". This article provides an overview and introduction, and the main purpose of this article is to provide an example of using the appearance style API and PrintWindow API. This article also provides a refresh program for using some previous Win32 APIs.
This article will introduce the TaskSwitcher application, which has the same functions as the existing AltTab mechanism in Windows. In addition to the display icon list, the application also displays the thumbnail preview of the application to be switched. The application icon and the preview container window are displayed through the appearance style API, so that the appearance of the application conforms to the current style selected by the end user.
TaskSwitcher Application
TaskSwitcher is designed to replace the existing AltTab application switching mechanism of Windows XP. AltTab is a built-in Windows superuser function that enables end users to quickly switch between top-level application Windows. When you press the hot key to combine Alt + Tab, Windows will generate a list of opened Windows in use by the end user. The list of opened windows is displayed as a set of icons, one of which has a selection border with a rectangle. When the end user continues to press the Alt key and the Tab key, the rectangular selection box is moved to the next icon. After the Alt key is released, Windows places the application represented by the selected icon on the foreground.