How to: Search for a Window in Windows View

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can search for a specific window in Windows view by using its handle, caption, class, or a combination of its caption and class as search criteria. You can also specify the initial direction of the search. The fields in the dialog box will show the attributes of the selected window in the window tree.

Start with the tree expanded to the second level (all windows that are children of the desktop), so that you can identify desktop-level windows by their class name and title. Once you have chosen a desktop-level window, you can expand that level to find a specific child window.

To search for a window in Windows view

  1. Arrange your windows so that Spy++, the Windows View window, and the target window are visible.

  2. From the Search menu, choose Find Window.

    The Window Search Dialog Box opens.

    Tip

    To reduce screen clutter, select the Hide Spy option. This option conceals the main Spy++ window and leaves only the Window Search dialog box visible on top of your other applications. The Spy++ main window is restored when you click OK or Cancel, or when you clear the Hide Spy++ option.

  3. Drag the Finder Tool over the target window. As you drag the tool, the Window Search dialog box displays details on the selected window.

    – or –

    If you know the handle of the window you want (for example, from the debugger), you can type it in the Handle box.

    – or –

    If you know the caption and/or class of the window you want, you can type them in the Caption and Class text boxes, and clear the Handle text box.

  4. Choose Up or Down for the initial direction of the search.

  5. Click OK.

    If a matching window is found, it is highlighted in the Windows View window.