AppList (statement)

Syntax

AppList AppNames$()

Description

Fills an array with the names of all open applications.

Comments

The AppNames$ parameter must specify either a zero- or one-dimensioned dynamic String array or a one-dimensional fixed String array. If the array is dynamic, then it will be redimensioned to match the number of open applications. For fixed arrays, AppList first erases each array element, then begins assigning application names to the elements in the array. If there are fewer elements than will fit in the array, then the remaining elements are unused. The script returns a runtime error if the array is too small to hold the new elements.

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

Example

This example minimizes all applications on the desktop.

Sub Main()

  Dim apps$()
  AppList apps

  'Check to see whether any applications were found.
  If ArrayDims(apps) = 0 Then Exit Sub

  For i = LBound(apps) To UBound(apps)
    AppMinimize apps(i)
  Next i
End Sub

Notes

The name of an application is considered to be the exact text that appears in the title bar of the application's main window.

More information

A