-
Let's say I have program that a user can enter some text into a textbox (txtDetails). And there is a seperate 3rd party program that has a form with a single text box on it.
If I already know the 3rd party program's textbox hWnd (238), how do I properly paste txtDetails.Text in it's text box?
Any help will be greatly appreciated and certainly rewarded with my undying graditude,
Daniel Christie
-
Yuo can use the SendMessage API with the WM_SETTEXT Constant, ie.
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_SETTEXT = &HC
Private Sub Command1_Click()
Dim sText As String
sText = Text1
Call SendMessage(lHwnd, WM_SETTEXT, Len(sText), ByVal sText)
End Sub
Where lHwnd is the WindowHandle of the Textbox in the 3rd Party App.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Thank you very, very much Aaron :)