how can i send words to other app's text from my app?
i want use the sendwindowtext() ,but i don't know the name of the form ,i only know the hwnd of the app and the name of the text whice is i want to send words to. how can i do.
Printable View
how can i send words to other app's text from my app?
i want use the sendwindowtext() ,but i don't know the name of the form ,i only know the hwnd of the app and the name of the text whice is i want to send words to. how can i do.
VB Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, _ ByVal lpszClassName As String, ByVal lpszWindowCaption As String) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _ ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As String) As Long Private Const WM_SETTEXT As Long = &HC Dim hwndTxtBox As Long hwndTxtBox = FindWindowEx("<Window handle>", 0&, vbNullString, "<text box name>") SendMessage hwndTxtBox, WM_SETTEXT, 0&, "MY String"
You could use a MS Winsock Control
While definitely a way to accomplish the goal, wouldn't it be overkill if he already knows the handle?