Board index » cppbuilder » keyboard event for special characters
DeKayA
![]() CBuilder Developer |
keyboard event for special characters2006-10-19 01:33:42 AM cppbuilder41 Maybe I am doing this all wrong! Code follows the narration... I am retrieving characters from a listbox and sending them one at a time to a running DOS program. (win2k CMD actually) The program was selected in a previous routine and the characters are indeed sent to the open CMD prompt. I have noticed all character must be in upper case for the cmd to receive them so, as an example the text box has the following lines in it. TELNET MAIL.SOMEWHERE.COM 25 HELO ME This works but the "." is not interpreted correctly I discovered that a lower case "n" is interpreted as a . MAIL FROM: SOMEONE@SOMEWHEREnNET // notice the "n" for a period RCPT TO: dekaya@SOMEWHEREnNET But that is not the correct approach because I can't send the needed @ symbol DATA From: RemoteAccess To: XXXX@XXXXX.COM Subj: What is My IP Address Bottom line: How do I send CR/LF and special characters --------------------------------------------------------- void __fastcall TForm1::SendKey(String SCharacter) { HWND handle; handle = FindWindow(NULL, EditTargetApp->Text.c_str()); if(handle != NULL) { char *character = SCharacter.c_str(); // bring it to the front SetForegroundWindow(handle); // send the letter to the program; parameter MUST be uppercase keybd_event(*character, 0, 0, 0); keybd_event(*character, 0, KEYEVENTF_KEYUP, 0); } } |