GetWindowsList
System function.
The GetWindowsList function returns the list of parent window names present on Windows desktop. Not available in WinTask Lite.
Syntax
GetWindowsList(<tab_namewin$>,<tab_instanc>,<tab_handl>,<tab_flag$>)
or
Ret=GetWindowsList(<tab_namewin$>,<tab_instanc>,<tab_handl>,<tab_flag$>)Parameters
<tab_namewin$>, alphanumeric array; it lists the names of the parent windows present on the desktop. These names use the syntax as described in the UseWindow statement.
<tab_instanc>: integer array; lists the instance numbers of each parent window present on the desktop.
<tab_handl>: integer array; lists the handle of each parent window present on the desktop.
<tab_flag$>: alphanumeric array; two characters containing the status of the application or of the window. The first character is 1 if the status is " running ", 0 if not. The second character is 1 if the application is enabled (it can receive actions), 0 if disabled.
Return value
Ret, integer, return code which gives the number of found windows. If any of the arrays is too small, ret contains -1, but the arrays will still contain the first n windows found (if #IgnoreErrors=1). If Ret=-1 and if #IgnoreErrors=0, the script is stopped.
Example code
dim namewin$(210)
dim numinst(210)
dim handlewin(210)
dim winflag$(210)
proc$="namewin.txt"
create(proc$)
p=GetWindowsList(namewin$(),numinst(),handlewin(),winflag$())
write(proc$,str$(p),CRLF)
i=0
repeat
'The list is written to the file
write(proc$,namewin$(i)+","+str$(numinst(i))+","+str$(handlewin(i)) +"," +winflag$(i),CRLF)
i=i+1
until i=p
pause 1
' the list is displayed
shell("notepad "+proc$)
See also the script example, Close all Internet Explorer windows.