Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wCmd As Long) As Long Declare Function GetWindowText Lib "user32" _ Alias "GetWindowTextA" ( byval hwnd As Long, byval lpString As String,byval cch As Long) As Long Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Public Const GW_HWNDFIRST = 0 Public Const GW_HWNDLAST = 1 Public Const GW_HWNDNEXT = 2 Public Const GW_HWNDPREV = 3 Public Const GW_OWNER = 4 Public Const GW_CHILD = 5 declare sub Command1_Click declare sub Command3_Click DIM Form AS QForm Form.center Form.width=640 Form.height=480 Form.caption="qwerty" DIM ListBox AS QListBox ListBox.Parent = Form ListBox.width=400 ListBox.height=400 Command1_Click Form.ShowModal Sub Command1_Click Dim hwnd as long dim dummy as long Dim strCaption as string ListBox.Clear hwnd = GetDesktopWindow ' Рабочий стол - самое пеpвое окно/ '' print "hwnd=" ,hwnd _' Пеpвое дочеpнее окно - окно пеpвого ypовня_ hwnd = GetWindow(hwnd, GW_CHILD) '' print "hwnd=" ,hwnd _' Тепеpь полyчим заголовки окон всех ypовней_ Do dummy = GetWindowTextLength(hwnd) If dummy <> 0 Then '' print "dummy=" ,dummy strCaption = String$(dummy + 1, "=") dummy = GetWindowText(hwnd, @strCaption, dummy + 1) print "strCaption=" ,strCaption ListBox.AddItems strCaption End If hwnd = GetWindow(hwnd, GW_HWNDNEXT) Loop until hwnd = 0 End Sub Sub Command3_Click ListBox.Clear End Sub