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:
  1. Private Sub Command1_Click()
  2.  Dim DRText As String
  3.  
  4. Dim gwintext As String  ' receives the copied text from the target window
  5. Dim glength As Long  ' length of the window text
  6. Dim gretval As Long  ' return value of message
  7.  
  8.  
  9. glength = SendMessage(DRGame, WM_GETTEXTLENGTH, CLng(0), CLng(0)) + 1
  10. gwintext = Space(glength)
  11.  
  12. gretval = SendMessage(DRGame, WM_GETTEXT, ByVal glength, ByVal gwintext)
  13.  
  14. DRText = Left(gwintext, gretval)
  15.  
  16.  Text1.Text = DRText
  17. End Sub
  18.  
  19.  
  20.  
  21. Private Sub Form_Load()
  22. 'Sets Caption for Taskbar Item
  23.  
  24. 'Finds DRTextbox
  25. 'Finds DR
  26. EnumWindows AddressOf EnumWindowsProc, 0
  27. EnumChildWindows DRhwnd, AddressOf EnumChildProc, 0
  28. EnumChildWindows DRhwnd, AddressOf EnumGameProc, 0
  29.  
  30. End Sub

btw I'm not trying to get the caption of the window but its actualy
content, Anyone have any ideas ?