Use the FindWindow API to get the handle of the window then use the following function to retrieve the text:

VB Code:
  1. Public Declare Function FindWindow Lib "user32" &_
  2. Alias "FindWindowA" (ByVal lpClassName As String, ByVal &_
  3. lpWindowName As String) As Long
  4. Public Declare Function FindWindowEx Lib "user32" &_
  5. Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As &_
  6.  Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  7.  
  8. Public Function GetText(Window As Long) As String
  9. Dim Cursor As String, Text As Long
  10.   Text& = SendMessage(Window&, WM_GETTEXTLENGTH, 0&, 0&)
  11.   Cursor$ = String(Text&, 0&)
  12.   Call SendMessageByString(Window&, WM_GETTEXT, Text& + 1, Cursor$)
  13.   GetText$ = Cursor$
  14. End Function