I have seen programs that allow you to send keys, and, as you know, I was wondering how to. I have one small problem. I can send the text to notepad, etc, but not to an AIM window. I have seen programs that can. Here's some code:

szIndex=SendMessage(listWin, LB_GETCURSEL, 0, 0);
SendMessage(listWin, LB_GETTEXT, (LPARAM)szIndex, (WPARAM)szWinName);

GetWindowText(kSend, winText, 1284);

while(szFindWin==0)
szFindWin=FindWindow(szWinName, 0);

while(szFindWin_Chld==0)
szFindWin_Chld=FindWindowEx(szFindWin, 0, "Edit", 0);

for(int y=0; y < strlen(winText) + 1; y++)
{
SendMessage(szFindWin_Chld, WM_CHAR, (WPARAM)winText[y], (LPARAM)1284);
}


That code works with Notepad's edit, but it freezes when I try it with an AIM window. What do I do? BTW, winText is declared as TCHAR