The class Windows (gb.qt4) returns a collection of all windows opened by a Gambas program. The (static) class has only one property: Windows.Count returns the number of windows opened by a Gambas program. You can use the Windows class like a read-only array.
Example:
Public Sub btnShowInformations_Click() Dim i As Integer Dim hWindow As Window Print "Number of open windows = "; Windows.Count Print For Each hWindow In Windows Inc i Print i; ". Window: "; "Caption = "; hWindow.Caption Print i; ". Window: "; "Window-height = "; hWindow.H Print "------------------------------------------" Next End ' btnShowInformations
Figure 12.10.1: Three open windows of a Gambas programme.
For the application with three open windows → Figure 12.10.1 results in the following output in the console of the IDE:
Number of open windows = 3 1. Window: Caption = un-embed-forms 1. Window: Window-height = 336 ------------------------------------------ 2. Window: Caption = Window 1 2. Window: Window-height = 144 ------------------------------------------ 3. Window: Caption = Window 2 3. Window: Window-height = 144