non è ancora perfetto ma deve essere una buona base di partenza
codice:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" _
(ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Const GW_HWNDNEXT = 2
Private Sub Form_activate()
Dim lTrayHwnd As Long
Dim lChildHwnd As Long
Dim sSave As String
'trova l'handle della barra
lTrayHwnd = FindWindow("Shell_traywnd", vbNullString)
lChildHwnd = Me.hwnd
Do Until lChildHwnd = 0
sSave = Space$(255)
Call GetWindowText(lChildHwnd, sSave, 255)
sSave = Trim$(sSave)
sSave = Mid$(sSave, 1, Len(sSave) - 1)
If Len(Trim$(sSave)) > 1 Then
If IsWindowVisible(lChildHwnd) > 0 Then
List1.AddItem Trim$(sSave)
End If
End If
lChildHwnd = GetWindow(lChildHwnd, GW_HWNDNEXT)
Me.Refresh
Loop
End Sub
in effetti c'è dal risolvere il problema delle finestre visible ma non visibili