Hi, This is really puzzling me, as nothing i do seems to work.

[bold]What im trying to do[/bold]
I am trying to take the contents of an Instant Message window and copy it into my program, However the code i am using will only copy it as plain text (NOT RICH TEXT). Also it fails if the user doesn't have the IM window selected!

So if anyone knows what im doing wrong please tell me, Thanks for any help.

This is the code i am using at the moment it is in a timer:
Code:
Dim aolframe As Long, mdiclient As Long, aolchild As Long
Dim richcntl As Long
aolframe = FindWindow("aol frame25", vbNullString)
mdiclient = FindWindowEx(aolframe, 0&, "mdiclient", vbNullString)
aolchild = FindWindowEx(mdiclient, 0&, "aol child", vbNullString)
richcntl = FindWindowEx(aolchild, 0&, "richcntl", vbNullString)
Dim TheText As String, TL As Long
TL = SendMessageLong(richcntl, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessageByString(richcntl, WM_GETTEXT, TL + 1, TheText)
Me.Text1.Text = Left(TheText, TL)
Thanks for any help.