Original Post
ok, im trying to write a real time logging program to work with instant messanger, and ive run into a problem. This is what I have so far...
There are two problems, first of all I don''t know how to get only ''iTextDifference'' characters from the END of szTextBuffer into a seperate string. And two, my entire method here is flawed, because i could easily overflow the text buffer, especially when you take into account the text retrieved with WM_GETTEXT is HTML, not plaintext. But i figure this might at least give you an idea of what im trying to do, and maybe someone could point me in the right direction.
int iOldTextLength = 0;
int iTextLength = 0;
char szTextBuffer[10000];
iTextLength = SendMessage( IMWatchList[0].GetIMRecvHwnd(), WM_GETTEXTLENGTH, 0, 0 );
if( iTextLength > iOldTextLength )
{
// New message recieved
int iTextDifference = iTextLength - iOldTextLength;
SendMessage( IMWatchList[0].GetIMRecvHwnd(), WM_GETTEXT, (WPARAM)iTextLength, (LPARAM)szTextBuffer );
}
iOldTextLength = iTextLength;