Results 1 to 4 of 4

Thread: how can i send words to other app's text from my app

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    china(ÖØÇì)
    Posts
    60

    how can i send words to other app's text from my app

    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.
    I am a vb fine,
    but my English was poor.

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    VB Code:
    1. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    2. (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, _
    3. ByVal lpszClassName As String, ByVal lpszWindowCaption As String) As Long
    4.  
    5. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
    6.      ByVal hwnd As Long, ByVal wMsg As Long, _
    7.      ByVal wParam As Long, ByVal lParam As String) As Long
    8.  
    9. Private Const WM_SETTEXT As Long = &HC
    10.  
    11.  
    12. Dim hwndTxtBox As Long
    13.     hwndTxtBox = FindWindowEx("<Window handle>", 0&, vbNullString, "<text box name>")
    14.     SendMessage hwndTxtBox, WM_SETTEXT, 0&, "MY String"

  3. #3
    Junior Member
    Join Date
    Nov 2002
    Location
    @ my PC
    Posts
    27
    You could use a MS Winsock Control
    [vbcode]
    Start:
    '...thinks... ...remembers... ...forgets...
    If Not gotanswer Then
    GoTo Start
    Else
    'dur - it'l never get here
    End If
    [/vbcode]

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    While definitely a way to accomplish the goal, wouldn't it be overkill if he already knows the handle?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width