System.LastWindowIndex

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aSystem.LastWindowIndex

New in 2019r2

Supported for all project types and targets.

Returns the index of the last open window.

Sample Code

This code places the titles of all open windows into a ListBox:

For i As Integer = 0 To System.LastWindowIndex
Var w As Window = System.Window(i)
If w <> Nil Then
ListBox1.AddRow(w.Title)
End If
Next

See Also

Application.WindowCount method; Window class.