Spy

The Spy tool included in WinTask allows you to find the name of a window and the arguments for the UseWindow function. It is used too when you want to extract data from a website. Spy tool can find window names for 32 bits applications under a x64 Windows but cannot find a pure x64 window.

The window name is usually found automatically when you use Recording mode. But occasionally, the error message "Window not found" can occur during execution. The Spy tool can help solving this problem and determining which window name is needed.

The SPY dialog box is displayed by selecting the Start/Spy menu in the WinTask Editor window.

Click Find Window. Move the mouse on the desktop. When a window is found, the mouse cursor changes to a cross-hair pointer.

The window name is shown in the "UseWindow" field. Other window identifiers are listed below :

Appl

Application name

Module

Executable module name

Class

Window class

Title

Window title

Index

Index of the control (if the same control appears several times inside the window)

Id

Window ID

Instance

Instance number (if several instances of the same window are loaded)

Handle

Window handle in hexa - Note that GetTopWindowHandle, GetFocusWindowHandle and GetWindowHandle function return the handle as an integer

It is possible to truncate this window name in the "UseWindow" field ; delete rightmost characters if you want to use a truncated window name in a UseWindow statement. Click Validate to check that the window name is still correct. If window name changes from one replay to another, truncate the window name to keep only the beginning of the window name which does not change (see Window name, wildcards topic).

Click Paste to paste window name found by the SPY tool into the script. This window name can be used as the argument for the UseWindow function.

If Spy tool is used on a Web page, the "Web Information" part of Spy window is filled if the mouse is on an HTML element which can be captured for retrieving the text displayed.

The field "HTML tag" provides the tag name for the HTML element where the mouse is. The supported ones are :

<address>

supplies the author's contact information

<blockquote>

enclosed text is a lengthy quotation

<dd>

defines an item within a definition list

<div>

denotes a generic division within the document

<dl>

definition list with terms (<dt>) and definitions (<dd>)

<dt>

term portion of an item within a definition list

<h1>,...<h6>

enclosed text is a heading

<li>

defines an item in a list

<ol>

defines an ordered (numbered) list

<p>

defines a paragraph

<table>

defines a table

<ul>

defines an unordered (bulleted) list

By clicking the mouse when one of this HTML tag is found and if WinTask editor is opened, the button HTML capture becomes active in order to generate automatically in the WinTask script the statements which will capture the inner text of this tag at replay. Then the Content validation dialog box is displayed. See Web, how to capture data for a step by step data extraction example.

The fields Coordinate X and Coordinate Y gives the mouse coordinates in pixels relative to the Web page top left corner. They can be used for generating easily the ClickMouse function.

See also :

window not found error message