Getting Text From Another Program
What I'm trying to do is get text inside of a text box in another program. I've tried a bunch of stuff but nothing seems to work,
i'll either get a response of zero or get nothing.
Anyone able to Help ?
VB Code:
Private Sub Command1_Click()
Dim DRText As String
Dim gwintext As String ' receives the copied text from the target window
Dim glength As Long ' length of the window text
Dim gretval As Long ' return value of message
glength = SendMessage(DRGame, WM_GETTEXTLENGTH, CLng(0), CLng(0)) + 1
gwintext = Space(glength)
gretval = SendMessage(DRGame, WM_GETTEXT, ByVal glength, ByVal gwintext)
DRText = Left(gwintext, gretval)
Text1.Text = DRText
End Sub
Private Sub Form_Load()
'Sets Caption for Taskbar Item
'Finds DRTextbox
'Finds DR
EnumWindows AddressOf EnumWindowsProc, 0
EnumChildWindows DRhwnd, AddressOf EnumChildProc, 0
EnumChildWindows DRhwnd, AddressOf EnumGameProc, 0
End Sub
btw I'm not trying to get the caption of the window but its actualy
content, Anyone have any ideas ?