- Table of Contents
- Copyright
- About the Authors
- About the Contributors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- How to Use This Book
- What You Need to Use This Book
- What's New in Visual C++ 6.0
- Contacting the Main Author
- Part I: Introduction
- Chapter 1. The Visual C++ 6.0 Environment
- Part II: MFC Programming
- Chapter 2. MFC Class Library Overview
- Chapter 3. MFC Message Handling Mechanism
- Chapter 4. The Document View Architecture
- Chapter 5. Creating and Using Dialog Boxes
- Chapter 6. Working with Device Contexts and GDI Objects
- Chapter 7. Creating and Using Property Sheets
- Chapter 8. Working with the File System
- Chapter 9. Using Serialization with File and Archive Objects
- Part III: Internet Programming with MFC
- Chapter 10. MFC and the Internet Server API (ISAPI)
- Chapter 11. The WinInet API
- Chapter 12. MFC HTML Support
- Part IV: Advanced Programming Topics
- Chapter 13. Using the Standard C++ Library
- Chapter 14. Error Detection and Exception Handling Techniques
- Chapter 15. Debugging and Profiling Strategies
- Chapter 16. Multithreading
- Chapter 17. Using Scripting and Other Tools to Automate the Visual C++ IDE
- Part V: Database Programming
- Chapter 18. Creating Custom AppWizards
- Chapter 19. Database Overview
- Chapter 20. ODBC Programming
- Chapter 21. MFC Database Classes
- Chapter 22. Using OLE DB
- Chapter 23. Programming with ADO
- Part VI: MFC Support for COM and ActiveX
- Chapter 24. Overview of COM and Active Technologies
- Chapter 25. Active Documents
- Chapter 26. Active Containers
- Chapter 27. Active Servers
- Chapter 28. ActiveX Controls
- Part VII: Using the Active Template Library
- Chapter 29. ATL Architecture
- Chapter 30. Creating COM Objects Using ATL
- Chapter 31. Creating ActiveX Controls Using ATL
- Chapter 32. Using ATL to Create MTS and COM+ Components
- Part VIII: Finishing Touches
- Chapter 33. Adding Windows Help
- Part IX: Appendix
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.
Using the OLE-COM Object Viewer | Next Section

Account Sign In
View your cart