-
WM_CHAR(AND TCHAR) Help!
With my program, I can send keys to Notepad when it's open:
I have this code for an AIM window:
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);
SendMessage(szFindWin_Chld, WM_CHAR, (WPARAM)winText, (LPARAM)0);
break;
And winText is declared first with TCHAR. When I want it to send to an AIM window, it doesn't and it freezes and I have to restart my program. How would I find the edit box to send key in an AIM window?
-
It may be freezing your program because FindWindowEx() never finds an editbox so searches forever, maybe AIM doesn't use editboxes. If you've verfied that you have a valid handle to the main AIM window, you could try searching for other types of control that accept text input (Richedit control), or use EnumChildWindows() to enumerate all of AIM's child windows and see if you can find a way to write to any of them.
-
Thanks...
-
What is---
What is the class name for a Rich Edit? "rich", "richedit" what?