How did you declare the SendMessage API?
Try declaring a second (typesafe) function, just for the strings. Like:
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long

Did you initialize the string? eg
ReceivedText = Space(iLength)
Call SendMessage(hwnd1, WM_GETTEXT, iLength, ReceivedText)