This is my code that i have so far. what wrong with it. i want to get the text in notepad and put in in the text box of my form.
Private Sub Command1_Click()
Dim notepad As Long, editx As Long
notepad = FindWindow("notepad", vbNullString)
editx = FindWindowEx(notepad, 0&, "edit", vbNullString)
Dim TheText As String, TL As Long
TL = SendMessageLong(editx, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessageByString(editx, WM_GETTEXT, TL + 1, TheText)
TheText = Left(TheText, TL)
End Sub