Grabbing Text from a Window

Hi, I am trying to modify some code that grabs the contents of a chat window. Unfortunately the code is for MSN Messenger, and I'd like to try it with AIM. Basically, when executed, it takes the text from the window, copies it to the clipboard and then prints it out.

It basically gets the HWND by checking whether there is a MSN Conversation window open. This is done by using the EnumWindows() API. If it's open, it gets its HWND and checks its child windows to find a window having the window class 'RichEdit20W' or 'RichEdit20A'; this is done by using the EnumChildWindows() API. After getting the HWND of the conversation text window, it sends WM_COPY a message.

The problem is that AIM doesn't use RichEdit20W, it uses AteWindow. In Spy++ the hierarchy looks like:

Original

A Few Notes ...

Well, I have tried this before, so I know what you're doing. When you do this you will need to find the [childchild] window. You will have to send the WM_GETTEXT message to this window. But, it will return in HTML format (<font=**>), etc. I have not found a way to get JUST plain text. I hope this helps you out even a little bit.