1-click AWS Deployment 1-click Azure Deployment


Spy tool to inspect UI Automation Elements on your desktop. It queries properties and control patterns information for the Automation objects that you select in navigation tree or pick from screen using the mouse pointer. 

See buttons tooltips for hints on how to use them. You can copy values of properties using the context menu. You can also monitor UI Automation events raised by UI elements. Additionally, you can make actions on Automation elements using control patterns. This is a tool for UI Automation (UIA) developers. 

Introducing Spy++ 

Spy++ lets you perform the following tasks: 

  • Display a graphical tree of relationships among system objects. These include processes, threads, and windows. 
  • Search for specified windows, threads, processes, or messages. 
  • View the properties of selected windows, threads, processes, or messages. 
  • Select a window, thread, process, or message directly in the view. 
  • Use the Finder Tool to select a window by mouse pointer positioning. 
  • Set message option by using complex message log selection parameters. 

Spy++ has a toolbar and hyperlinks to help you work faster. It also provides a Refresh command to update the active view, a Window Finder Tool to make spying easier, and a Font dialog box to customize view windows. Additionally, Spy++ lets you save and restore user preferences. 

64-Bit Operating Systems 

There are two versions of Spy++. The first version, named Spy++ (spyxx.exe), is designed to display messages sent to a window that is running in a 32-bit process. For example, Visual Studio runs in a 32-bit process. Therefore, you can use Spy++ to display messages sent to Solution Explorer. Because the default configuration for most builds in Visual Studio is to run in a 32-bit process, this first version of Spy++ is the one that is available on the Tools menu in Visual Studio, if required components are installed. 

The second version, named Spy++ (64-bit) (spyxx_amd64.exe), is designed to display messages sent to a window that is running in a 64-bit process. For example, on a 64-bit operating system, Notepad runs in a 64-bit process. Therefore, you can use Spy++ (64-bit) to display messages sent to Notepad. Spy++ (64-bit) is typically located in 

..\Visual Studio installation folder\Common7\Tools\spyxx_amd64.exe. 

How to: Start Spy++ 

You can start Spy++ either from Visual Studio or at a command prompt. 

When you start Spy++, if a message is displayed to ask permission to make changes to the computer, select Yes. 


py++ requires the following components. You can select these components from the Visual Studio Installer by selecting the Individual Components tab, and then selecting the following components. 

  • Under Debugging and testing, select C++ profiling tools 
  • Under Development activities, select C++ core features 

If you made any changes, follow the prompts to install these components. 

Start Spy++ from Visual Studio 

On the Tools menu, select Spy++. 

Because Spy++ runs independently, after you start it you can close Visual Studio. 

Start Spy++ at a command prompt 

  1. In a Command Prompt window, change directories to the folder that contains spyxx.exe. Typically, the path to this folder is ..\Visual Studio installation folder\Common7\Tools\. 
  2. Enter spyxx.exe. 

Using Spy++ 

Spy++ (SPYXX.EXE) is a Win32-based utility that gives you a graphical view of the system’s processes, threads, windows, and window messages. This section of the Spy++ Help includes the following help topics: 

How does Spy++ highlighting work 

 in Spy++, if you are navigating the window tree hierarchy where it lists Windows parents and there children there is an option where you can right click on one of those elements and click “Highlight”. When you do that it will flash a border around the window showing you where it is on the UI.

I would like to learn how to do that with VB6. I want to use the feature highlight windows and there controls to create sort of a tutorial to teach somebody how to do something, ie first push this button (highlight) and then push this button (highlight) etc… 

 Using Spy 

 to use Spy++, another Visual C++ utility. This useful, popular utility can display information about all current processes, their threads, and all open windows—even hidden windows. 

After this lesson, you will be able to: 

  • Execute the Spy++ utility and use it to display a graphical tree of relationships among system objects, including processes, threads, and windows. 
  • Use Spy++ to search for specified windows, threads, processes, or messages. 
  • View the properties of selected windows, threads, and processes. 
  • Use the Spy++ Finder tool to select a window for monitoring. 
  • View a real-time record of messages that a window sends and receives. 

Estimated lesson time: 15 minutes 

Spy++ Views 

Start Spy++ the same way as you would the Dependency Walker, by selecting it from the Microsoft Visual Studio 6.0 Tools menu. The utility displays four main views: 

  • Windows view shows a list of open windows. 
  • Processes view lists current processes. 
  • Threads view lists all current threads. 
  • Message log lists the messages that a window receives. 

These four views are activated by commands in the Spy menu, or by the first four buttons on the toolbar. Each time a command is invoked, it creates a view as a new child window, so the tool buttons do not toggle between existing views. Instead, you should create a view only once, and thereafter switch between views by making a selection in the Window menu. Like the Dependency Walker, Spy++ is an MDI program, so you can tile views within the client area. 

A Spy++ view represents a snapshot, so applications that begin running after Spy++ are not automatically added to the lists. Similarly, applications that terminate while Spy++ is executing are not automatically removed from the list. To update a view, give the view focus and click the Refresh command on the Window menu. 

Windows View 

The Windows view displays a list of all windows currently open. It does not matter if the window is hidden or not; many open windows in a typical Windows session are invisible, serving their various applications only as message receivers. When Spy++ begins or when the view is refreshed, the utility compiles a list of all windows and displays the list in the Windows view. 

The list is a normal tree view with small plus and minus icons that collapse or expand the list into levels. The tree’s hierarchy indicates window parentage—that is, the relation between windows in which one window can create others as child windows. Click any plus icon adjacent to a window to expand the list to include that window’s children. If the plus icon does not appear next to a window, it means that the window does not have any children. 

A typical list in the Windows view can include many windows, so it’s sometimes difficult to locate the entry for a particular window. In these cases, use the Window Finder tool. 

  To use the Window Finder tool 

  1. Arrange the screen so that Spy++ and the window you want to investigate are both visible on the screen. 
  2. On the Spy++ toolbar, click Find Window, or choose Find Window from the Search menu. 
  3.  As the dragged icon passes over an exposed window, the window appears framed in thick black lines, and the Find Window dialog box notes the window’s handle. Drop the icon over the window you want, and close the Find Window dialog box. You can then locate the window’s entry in the list by scanning for its window handle. 

Processes View and Threads View 

Each process running in the Windows multitasking environment creates one or more threads; each thread can create any number of windows. Use the Processes view to examine a particular process, which usually corresponds to an executing program. Processes are identified by module names, or are designated system processes. 

The Threads view lists all currently executing threads along with the names of their owner processes. Expand a thread entry to see a list of its associated windows. 

Message Log 

For debugging purposes, the message log is perhaps the most useful of Spy++’s capabilities. It keeps a record in real-time of all messages that a window sends or receives. This allows you to examine a list of messages to see in what order they arrive, which is particularly useful for capturing window initialization messages. 

A convenient way to begin message logging for a window is by using the Window Finder tool described earlier. 

  To log messages using Window Finder 

  1. Drag and drop the Finder Tool icon over a target window as you did previously. In this instance, click the Messages radio button at the bottom of the Find Window dialog box before closing the dialog box. 

The Spy++ message log is divided into four columns: 

The Four Columns of the Spy++ Message Log 

Column  Description 
1  Index number showing the message count 
2  Window handle 
3  Message code: either S (sent), R (received), P (posted), or s (message was sent, but security prevents access to the return value) 
4  Message, parameters, and return values 

By default, the list includes all messages, including mouse movement and keystroke messages such as WM_KEYDOWN and WM_KEYUP. This means the list can get crowded in a hurry, but Spy++ can filter the log to only those messages that interest you most. 

  1. On the Messages menu, click Options, then click the Messages tab. 
  1. Click the Clear All button to clear all the check boxes, then select only those check boxes for the messages you want to investigate. 
  1. End message tracking either by clicking the button with the stoplight icon on the Spy++ toolbar, or by clicking Stop Logging on the Messages menu. 

Viewing Window Messages in Spy++ 

In this practice exercise, you will launch the Spy++ utility and use it to spy on another application. By turning on the utility’s message logging feature, you can view in real time the messages belonging to a selected window. 

  To start Spy++ 

  1. On the Programs menu, click Start. 
  2. Click Microsoft Visual Studio 6.0, click Microsoft Visual Studio 6.0 Tools, and then click Spy++. 
  3. When the utility appears, click the Find Window tool on the toolbar and drag the Finder Tool icon and drop it onto another window. If no other application is running, drop the Finder Tool icon onto the desktop. 
  4. Click the Messages radio button at the bottom of the Find Window dialog box, and then close the dialog box. 
  5. Experiment by moving the mouse pointer over the selected window. You will see the many messages that the window sends and receives pertaining to mouse movement, such as WM_MOUSEMOVE and WM_SETCURSOR. 

Using The Spy++ Tool 

How To Use 

Open the other application, then open Spy++ in VS (Menu > Tools > Spy++) 

Under the Search menu, click “Find Window”. 

Click and Drag the Finder Tool, the little crosshair inside the miniature window, onto the other application, then let go. The dialog in Spy++ will tell you the Window Handle, Caption, and Class name of the other application. 

In general, you will want to find the Handle of the other window programatically, because it will be different every time the app is launched, but Spy++ is great for debugging your app. And, the class name won’t change from one instance of an app to another, so you can use Spy++ to get the class name, then use it in your call to FindWindow() or FindWindowEx() 

Getting ID Of Menu Items, Toolbars etc 

Spy > Log Messages
Use the target tool to select the window you want to trace
Click OK and all messages to do with that window start getting logged
Do the operation (like selecting a menu item pressign a toolbar button)
If your lucky and the ap opnes a new window then the trace will stop and pretty much the last entry will be the one you want (wID is the control ID you needyou need for the post message). If not you’ll just have to find it 

 Spy++, is a Visual C++ utility that reports information about executing programs. Spy++ can provide invaluable insight into an application’s behavior that is not available through the Visual C++ debugger. 

Spy++ displays four main views that show a list of windows, processes, threads, and messages pertaining to a particular window. The Window Finder tool aids in associating any exposed window with the list of windows that Spy++ displays. The message tracking feature intercepts and logs all messages that enter and leave a window, showing chronological order and the values of message parameters. The message log can be filtered to monitor messages of particular interest only. 

 Spy++ (SPYXX.EXE) is a Win32-based utility that gives you a graphical view of the system’s processes, threads, windows, and window messages.Spy++ has a toolbar and hyperlinks to help you work faster. It also provides a Refresh command to update the active view, a Window Finder Tool to make spying easier, and a Font dialog box to customize view windows. Additionally, Spy++ saves and restores user preferences.


Major Features of  Spy++

Spy++ lets you perform the following tasks:

  • Display a graphical tree of relationships among system objects. These include processes, threads, and windows.
  • Search for specified windows, threads, processes, or messages.
  • View the properties of selected windows, threads, processes, or messages.
  • Select a window, thread, process, or message directly in the view.
  • Use the Finder Tool to select a window by mouse pointer positioning.
  • Set by using complex message log selection parameters._asug_choosing_message_options


Capturing With spy++


Related Posts