Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Using Spy++

Spy++ is a Win32-based utility that gives a graphical view of the system's processes, threads, windows, and window messages. You can view the parent-child window relationships, as well as the flag settings and window positions.

Spy++ is a read-only program, which means that Spy++ does not change how the program runs or behaves, other than slowing down execution.

Spy++ has four views; these are discussed in the following sections.

Tree View

The Tree view displays a tree of all windows and controls in the system. One of the tools of this view is the Window Finder tool. You can use this tool to locate disabled child windows and discern which window to highlight if there are many child windows that overlap each other.

Within Tree view, you can locate a specific window, given the handle, caption, class, or a combination of the caption and class. You also can specify the direction of the search. If a window is found, it is highlighted in the Windows view.

Messages View

The Messages view views the message stream associated with each window. Message views also can capture messages from a thread or process. This view is helpful when you want to look at messages sent to windows owned by a specific thread or process. The initialization messages can be captured this way.

You can start or stop the message log and search through it using criteria such as the handle, message ID, or type.

Processes View

You use the Processes view to examine a specific system process. Processes are identified by module names, or they are designated as "system processes."

Note that Windows supports multiple processes, where each process can have one or more threads. Each thread then can have one or more associated top-level windows, and the window at the top level can have its own set of windows.

To search for a specific process, the process ID or module string is used as a search criterion. If a match is found, it is highlighted in the View window. To find all processes owned by a module, just enter the module name in the Module box, leaving the Process box blank.

Threads View

The Threads view displays all the threads with associated windows.

You can search for a specific thread by using its module string or thread ID as a search criterion. To find all threads owned by a module, enter the module name in the Module box, leaving the Thread box blank.

A full exploration of the Spy++ program is beyond the scope of this chapter, but you briefly looked at its strong points here. Spy++ is a vast and versatile tool that gives you a graphical view of the system's messages, processes, threads, and window structure.

Share ThisShare This

Informit Network