Read through the code of rChat:
http://code.google.com/p/rothui/sour...e/trunk/rChat/
NUM_CHAT_WINDOWS has the max number of chatframes. Available at loadup.
There is another function that can return the actual number of active chatframes but that is available after loadup only.
Blizzard ChatFrame code is in FrameXML/FloatingChatFrame.lua / .xml
Check for "FCF_GetNumActiveChatFrames()" in
https://github.com/tekkub/wow-ui-sou...gChatFrame.lua