How would I get the text from a text box in another application?
Printable View
How would I get the text from a text box in another application?
If you know the Handle of the Applications Textbox the you can use the SendMessage API with the WM_GETTEXT Constant, ie.Where lHwnd is the Handle of the Textbox.Code:Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_GETTEXT = &HD
Private Sub Command1_Click()
Dim sText As String
sText = Space(255)
sText = Left$(sText, SendMessage(lHwnd, WM_GETTEXT, 255, ByVal sText))
MsgBox sText
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert