GetWindowChildrenList – System Function**






GetWindowChildrenList Function


Description

The GetWindowChildrenList function returns the names and handles of the child windows of the specified parent window.

Usage

Used to list the child windows of a parent window.

Syntax

ret = GetWindowChildrenList(<window_name>, <window_instance>, <tab_handles>, <tab_names>, <tab_instances>)

Parameters

  • <window_name>: string, window name of the parent window from where the child windows are enumerated.
  • <window_instance>: integer, window instance of the parent window from where the child windows are enumerated.
  • <tab_handles>: array of integers, returns the handles of the child windows of <window_name>.
  • <tab_names>: array of strings, returns the window names of the child windows of <window_name>.
  • <tab_instances>: array of integers, returns the instance numbers of the child windows of <window_name>.

Return Value

ret: integer, number of child windows found.

See Also

GetWindowsList

Example

'Declare the arrays used by GetWindowChildrenList
Dim handle(20)
Dim name$(20)
Dim instance(20)
StartBrowser("IE", "www.wintask.com/demos/form.htm", 3)
UsePage("Form")
ClickHTMLElement("A[INNERTEXT='Popup window']")
ret = GetWindowChildrenList("IEXPLORE.EXE|#32770|Message from webpage", topinstance(), handle(), name$(), instance())
'Display the number of child windows
msgbox("Number of child windows of Message from web page parent window: " + str$(ret))
'Display the first child window name, its handle, and its instance number
msgbox("Name of the first child window: " + name$(0) + "  Handle: " + str$(handle(0)) + " Instance: " + str$(instance(0)))
'Display the second child window name, its handle, and its instance number
msgbox("Name of the second child window: " + name$(1) + "  Handle: " + str$(handle(1)) + " Instance: " + str$(instance(1)))
'Display the third child window name, its handle, and its instance number
msgbox("Name of the third child window: " + name$(2) + "  Handle: " + str$(handle(2)) + " Instance: " + str$(instance(2)))