VB Code:
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 FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Declare Function SendMessageByStr& Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal _
lParam As String)
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim x&
Dim richedit&
x& = FindWindow("#32770", vbNullString)
richedit& = FindWindowEx(x&, 0&, "richedit", vbNullChar)
SendMessageByStr richedit, WM_GETTEXT, 0, "hello"
End Sub