WinList (statement)


WinList ArrayOfWindows()


Fills the passed array with references to all the top-level windows.


The passed array must be declared as an array of HWND objects.

The ArrayOfWindows parameter must specify either a zero- or one-dimensioned dynamic array or a single-dimensioned fixed array. If the array is dynamic, then it will be redimensioned to exactly hold the new number of elements. For fixed arrays, each array element is first erased, then the new elements are placed into the array. If there are fewer elements than will fit in the array, then the remaining elements are unused. A runtime error results if the array is too small to hold the new elements.

After calling this function, use the LBound and UBound functions to determine the new size of the array.


This example minimizes all top-level windows.

Sub Main()

  Dim a() As HWND

  WinList a

  For i = 1 To UBound(a)

    WinMinimize a(i)

  Next i

End Sub

See Also

WinFind (function).

More information