Dejo un ejemplo simple del uso de SendMessage + WM_GETTEXT para el que le sirva.
Nota: no hace falta usar un timer es solo para facilitar el concepto
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
Private Const WM_GETTEXT = &HD: Private Const WM_SETTEXT = &HC
Private Sub Form_Load()
Timer1.Interval = 16
Me.AutoRedraw = True
Shell "calc"
End Sub
Private Sub Timer1_Timer()
Dim Hwndl As Long
Hwndl = FindWindow("SciCalc", vbNullString)
Hwndl = FindWindowEx(Hwndl, 0, "Edit", vbNullString)
Dim recibir As String: recibir = Space$(34)
Call SendMessage(Hwndl, WM_GETTEXT, ByVal 34, ByVal recibir)
Me.Cls
'Me.Print recibir
Me.Print Replace(recibir, vbNullChar, "")
End Sub
S2