testing, don't reply
VB Code:
  1. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  2. Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  3. Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
  4.  
  5. Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
  6.     Dim Length As Long
  7.     Dim sName As String
  8.     Dim Temp As String
  9.     Static iCount As Integer
  10.    
  11.     iCount = iCount + 1
  12.     Length = GetWindowTextLength(hwnd) + 1
  13.    
  14.     If Length > 1 Then
  15.       sName = Space(Length)
  16.       GetWindowText hwnd, sName, Length
  17.       Debug.Print Left(sName, Length - 1)
  18.     End If
  19.    
  20.     EnumWindowsProc = 1
  21. End Function