Phantom Documentation

[Help Home] [Phantom Home]
AddChild

void window.AddChild(window,string)

Applicable Classes: All

Return Type:
void
Parameters: window Child, string Name

Description:

This function adds a window as a child to the calling window. The child window will be referred to by the Name parameter. The new child window can be accessed as any other child window. If the calling window already has child windows, the new child will be placed at the end of the list. Note that the new child window must be an actual child of the real window the calling window references. If it is not, the window will not be found and an error will occur.

Example Code

# Start Notepad
System("c:\\windows\\system32\\notepad.exe");

# Create windows
window W = MainWin("Notepad*", "Notepad");
window E = MainWin(1, "Edit");

# Add the edit as a child
W.AddChild(E, "Edit");

# Show that the child was added
ListWindow(W);

# Perform some functions on the added child
W.Edit.SetText("Hello");
W.Edit.SetText("");

# Close Notepad
W.Close();

# Start Notepad
System("c:\\windows\\system32\\notepad.exe");


See Also: GetParent, GetChild


Copyright 2000-2011 Phantom Automated Solutions