Google Answers Logo
View Question
 
Q: How do I get the text from an AIM chat window? ( Answered,   1 Comment )
Question  
Subject: How do I get the text from an AIM chat window?
Category: Computers > Programming
Asked by: zombyw00f-ga
List Price: $10.00
Posted: 25 Sep 2003 18:00 PDT
Expires: 25 Oct 2003 18:00 PDT
Question ID: 260286
I am writing a program that will interface with AOL Instant Messenger.
 This program needs to see the messages coming into the chat window. 
I have tried using EM_GETTEXT, and this has not worked.  I'm thinking
maybe they are using a proprietary window.  Thanks.

Request for Question Clarification by joseleon-ga on 25 Sep 2003 23:33 PDT
Hello, zombyw00f:

  What programming language are you using? I will try to post some Delphi examples.

Regards.

Clarification of Question by zombyw00f-ga on 26 Sep 2003 00:24 PDT
Either C++ or Visual Basic would do.  Thank you.
Answer  
Subject: Re: How do I get the text from an AIM chat window?
Answered By: joseleon-ga on 11 Oct 2003 03:52 PDT
 
Hello, zombyw00f:

  Here is the C++ code that extracts the text from the AIM Chat
Window, if there is a problem or it doesn't fit your needs, please,
don't hesitate to request for a clarification, I will keep working on
it until you get the desired results:

HWND handle;
HWND child1;

//This is the buffer used to the text
//Customize it to your needs
char buffer[2000];	


//Tries to find the Chat Window
handle=FindWindow("AIM_ChatWnd",NULL);

if (handle)
{
  //Tries to find the Chat Log window, which is the first child
  child1=GetWindow(handle,GW_CHILD);
  if (child1)
  {
    //Gets the text
    SendMessage(child1, WM_GETTEXT, 2000, (LPARAM)buffer);

    //Shows it
    //The returned text is HTML
    MessageBox(0,buffer,"Text",0);
   }
  }

Be aware of the word wrapping when copying/pasting this code.

Regards.

Request for Answer Clarification by zombyw00f-ga on 14 Oct 2003 13:01 PDT
Thank you for your response.  I require 2 clarifications:

a) How do you know which chat window you are in.  In other words, is
this the chat with person A or person B?

b) Most importantly, I need an example in VB as well, since I no
longer have access to a C++ programmer.

I appreciate your help with this matter.  Thanks again!

Clarification of Answer by joseleon-ga on 14 Oct 2003 14:19 PDT
Hello, zmobyw00f:

  Regarding to know the chat window, that depends on the
implementation of your software, I don't know how do you plan to do
it, but you can distinguish between windows by the caption and modify
this line of code:

handle=FindWindow("AIM_ChatWnd",NULL); 

And change NULL to the caption of the Chat window you want to get the
text.

And regarding the VB code, I'm sorry, I'm not proficient in VB, I can
try to adapt it, but you will need to wait a bit, it's OK for you?.

Keep on requesting clarifications until you get satisfactory results,
I'm here to help you.

Regards.

Request for Answer Clarification by zombyw00f-ga on 14 Oct 2003 14:42 PDT
If you could have it for me within 2 weeks, that would be fantastic!

Clarification of Answer by joseleon-ga on 14 Oct 2003 23:31 PDT
Hello, zmobyw00f:

  I will try to do it.

Regards.
Comments  
Subject: Re: How do I get the text from an AIM chat window?
From: omniscientbeing-ga on 25 Sep 2003 18:10 PDT
 
Maybe you can work around actually interfacing with the AIM window,
and using the Windows API to use the clipboard copy-and-paste feature,
where it copies the AIM text after every new msg and pastes it into a
label or textbox in your application?

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy