LordSyko
May 16th, 2000, 03:46 AM
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 (ldsyko@earthlink.net)
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 (ldsyko@earthlink.net)