Results 1 to 5 of 5

Thread: API - Sending Text

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2

    Question

    I've made a Sub that I call within my program (this is for AOL) called SendToChat, so that:

    Call SendToChat("Blah blah")

    "blah blah" will be sent to chat, now all I want to be able to do right now is get it to the chat text box. Here is my API code:

    Public Sub SendToChat(Chat As String)
    'Sends a string of text to the chat window
    'and sends it
    Dim ParHand1 As Long
    Dim ParHand2 As Long
    Dim OurParent As Long
    Dim Hand1 As Long
    Dim OurHandle As Long

    ParHand1& = FindWindow("AOL Frame25", "America Online")
    ParHand2& = FindWindowEx(ParHand1&, 0, "MDIClient", vbNullString)
    OurParent& = FindWindowEx(ParHand2&, 0, "AOL Child", vbNullString)
    Hand1& = FindWindowEx(OurParent&, 0, "RICHCNTL", vbNullString)
    OurHandle& = FindWindowEx(OurParent&, Hand1&, "RICHCNTL", vbNullString)
    'finds the chat window text area

    Call SendMessageByString(OurHandle&, WM_SETTEXT, 0&, Chat$)
    'puts the string to send into the chat window text area

    --if you've guessed it hasn't worked you hit the jackpot. i have no idea why, if anyone can help please take a quick look and see if you know why. Its not something stupid like undefined variables etc. everything is declared and defined, but it won't work! help!
    -LordSyko ([email protected])

  2. #2
    Guest
    i am trying to make a program for napster that does the same stuff an AOL proggy does, but only for napster. I am also stuck on how to send text to the text box in napster. all i can do so far is find napsters handle and the textbox in which you type your text handle. i dont know what to do from then on. how do you put text into another programs text box from within yours? i think LordSyko is trying to do this also.

  3. #3
    Guest
    This is just a suggestion since I have no clue if that will help, but did you try the SendKeys function.

  4. #4
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Cool there was an error in the coding

    This is you code revised

    Dim ParHand1 As Long
    Dim ParHand2 As Long
    Dim OurParent As Long
    Dim Hand1 As Long
    Dim OurHandle As Long

    ParHand1& = FindWindow("AOL Frame25", 0&) '<--- the typo was here
    ParHand2& = FindWindowEx(ParHand1&, 0, "MDIClient", 0&)
    OurParent& = FindWindowEx(ParHand2&, 0, "AOL Child", 0&)
    Hand1& = FindWindowEx(OurParent&, 0&, "RICHCNTL", 0&)
    OurHandle& = FindWindowEx(OurParent&, Hand1&, "RICHCNTL", 0&)
    'finds the chat window text area
    Print ParHand1&
    Print ParHand2&
    Print OurParent&
    Print Hand1&

    Call SendMessageByString(OurHandle&, WM_SETTEXT, 0&, "HELLO")
    'puts the string to send into the chat window text area

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2
    thanks,
    i got it working a long time ago but i still appreciate the help ;-D
    -nate

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