Public Function EnumWindowsProc(ByVal HandleW As Long, _ ByVal lParam As Long) As Long Dim TextW As String Dim LenTextW As Long Dim Res As Long 'Добавить описатель в коллекцию HandleCol.Add HandleW 'Получить заголовок окна. TextW = VBA.String$(255, vbNullChar) LenTextW = VBA.Len(TextW) Res = GetWindowText(HandleW, TextW, LenTextW) If Res > 0 Then 'Добавить заголовок в коллекцию TextW = VBA.Left(TextW, Res) CaptCol.Add TextW End If 'Получить класс окна. TextW = VBA.String$(255, vbNullChar) LenTextW = VBA.Len(TextW) Res = GetClassName(HandleW, TextW, LenTextW) If Res > 0 Then 'Добавить имя класса в коллекцию TextW = VBA.Left(TextW, Res) ClassNameCol.Add TextW End If EnumWindowsProc = 1 End Function