 "Getting Chat Room Text w/VBMsg"

Getting the chat room text has always been somewhat of a problem for 
Programmers, some more than others but Never the less a problem. This
Article will explain, step by step, getting the chat room text using the
Custom Control VBMsg. 

Step 1  -- Get the AOL Window,  This is done by using Findwindow

AOLhwnd%=FindWindow("AOL Frame25",0&) ' This will find the Window no matter
                                      ' What the Caption is, This is 
                                      ' Necessary Because the AOL Caption
                                      ' Changes

Step 2  -- Find the  MDI Client in The AOL Window

This  is done by Using a  DO Loop, Getwindow, and GetClassName. Exp.


Childhwnd%=Getwindow(AOLhwnd%, GW_CHILD)

  Do

     X=GetClassname(Childhwnd%,RetStr$,255)  
     
       If Instr(RetStr$,"MDIClient")  Then
         
         MDIhwnd%=Childhwnd%
         Exit Do

       End If

 Childhwnd%=GetWindow(Childhwnd%,GW_HWNDNEXT)
  
 Loop Until Childhwnd%=0

In this Example, The First  Statement Gets the First Child  window Found
in the AOL Window. Then, It Gets the ClassName, Compares it by looking for
MDIClient, The Classname for the MDI Client in AOL. If it finds it it  sets 
MDIhwnd% to the Handle of the current Window, which would be the MDI Client
and exits The Loop. If it  does not find the MDI Client in this window, it
Get's  the Next  Child window until  either it finds the MDI Client  or 
Runs  out of Child Windows.

Step 3 -- Find the Chat window itself.

This is covered in Help #9

Step 4 -- Get the Handle  of the Class _AOL_View inside the Chat Window

This is done much like you would when finding any other window. You Use a
DO LOOP and GetClassName  to look for the ClassName _AOL_View  INSIDE The
Chat Window.  Once you find this,

VBMSG1.SubClasshwnd=<handle of _AOL_View>

This will begin the Subclassing of the AOLView and everytime somthing is
said  in the chat room, it will fire VBMsg1_WindowMessage Event, Covered 
Next.

Step 5 -- VBMsg and VBMsg_WindowMessage

This is the heart of getting the Chat room text, And may be the  Simpilest 
part. 

NOTE: This example uses a API Call from a DLL Call APIGUIDE, it  is 
necessary to have this DLL to use that API Call.

VBMsg_WindowMessage

ChatText$=agGetstringFromLPSTR$(lparam)

Text1.Text=Text1.Text+ChatText$

End  Sub

This  will give you the chat text! Note that the Text Box has a Maximum of
32000 bytes, you will need to figure that out on your own.

Step 6 *Final Step* -- Setting  VBMsg's  Propertites

You will need to Load the Propertities of VBMsg up, and select the 
property of WindowMessage..  Then, Select WM_SETTEXT..  There you Go!!

Written By DiVe PiE
