The elements of a Window Declaration
describe a window, menu, or control that a Phantom script interacts
with. There are five elements that describe a window:
Type - Indicates
what kind of a declaration the information represents. Can be either
a Menu or a MainWin.
Tag - The text
or number tag of the declaration. This corresponds to the window title
text if it exists. If there is not title text, or the type is Menu,
it corresponds to an index (n) number indicating it is the 'nth' child
of type Class in the parent window. If a tag is a text tag (the name
of a window), it must be enclosed in quotes ("). If it is an index
number, it must not be in quotes. If a wildcard (*) is manually
set in a text Tag, the interpreter will find the window that contains
the text to the left of the wildcard. If the text of the window may
change or is unknown, this can be a useful option. Setting the entire
tag to "*" causes the interpreter to find the first window
or child window that matches the Class.
Class - Indicates
the class of the object. This is the same class that the operating system
recognizes. This item must be in quotes (") and supports the use
of wildcards. The Window Types section describes this in more detail.
Parent - Indicates
whether or not the object is a parent to another object. A value of
1 is set if it is a parent, 0 otherwise. This item should generally
not be altered.
Child - Indicates
whether or not the object is a child of another object. A value of 1
is set if it is a child, 0 otherwise. This item should generally not
The syntax of a declaration is as follows:
[ ]Type "Name"
( )Parent =iParent
[ ]Type "SubName"
the name of the window. This is the name used in the Phantom script.
The Window Declarations Recorder can automatically create this name
based upon the window's text or class.
is the window title, or an index (without
quotes) if the window has no title or is a menu.
is the window's class name.
indicates if the object is a parent (1=it is a parent, 0=it is not a
if the object is a child (1=it is a child, 0=it is not a child).
is the name of the sub item or child
window. This is the name used in the Phantom script.
is the sub item or child window title.
is the sub item or child window class
indicates if the sub object is a parent.
indicates if the sub object is a child.
Notice that the elements are offset by a tab. This
indicates to the interpreter that the element belongs to the object
defined by Name. Notice also that the child item of the
main item is offset by a tab from the main item. This also serves
the purpose of informing the interpreter that the object is a child
of the previous object. The brackets prior to some of the elements
indicate a main element, with parentheses indicating additional element
information. In this fashion, the interpreter builds a tree
of objects for use by the script.
An example of a window declarations file is:
[ ]MainWin "Help"
( )Tag="Help Topics: Notepad Help"
[ ]MainWin "#327701"
[ ]MainWin "Click"
( )Tag="Click a..."
[ ]MainWin "SysTreeView321"
[ ]MainWin "Open"
[ ]MainWin "Print"
[ ]MainWin "Cancel"
[ ]MainWin "SysTabControl321"
Note that names are derived from the Tag of the object.
If the tag is a number, the name is derived from the class along with
a number. Also, all '.'s are converted to '_'s and '&'s are omitted
in the names.
See Also: The
Window Declarations Recorder, Using
Window Declarations, define, Editing