-
Wide char problems
ok well what im doing is making a program that sends text to a program..
the thing is i need it to be able to send unicode chares like
Ắ
and so on
heres what i have so far
Code:
case WM_COMMAND:
if ( (HWND) lParam == hwndButton1 ) {
POINT pt;
char go[] = "hook set";
MessageBox(0,"test","test",0);
GetCursorPos(&pt);
hackedh = WindowFromPoint(pt);
SendMessage(hwndEdit, WM_SETTEXT, (WPARAM) sizeof(""), (LPARAM) "");
SendMessage(hackedh, WM_SETTEXT, (WPARAM) sizeof(go), (LPARAM) go);
PostMessage(hackedh, WM_KEYUP, (WPARAM)VK_RETURN, (LPARAM)0);
}
if ( (HWND) lParam == hwndButton2 ) {
WCHAR TextBuffer[128];
SendMessageW(hwndEdit, WM_GETTEXT, (WPARAM) sizeof(TextBuffer), (LPARAM) TextBuffer);
SendMessageW(hackedh, WM_SETTEXT, (WPARAM) sizeof(TextBuffer), (LPARAM) TextBuffer);
PostMessage(hackedh, WM_KEYUP, (WPARAM)VK_RETURN, (LPARAM)0);
}
now when ii try to send chars like that it comes up as ?
also hwndEdit is a rich text box
please help..thanks
-
Well do you have UNICODE defined? I don't usually use WCHAR, I use TCHAR. In non unicode it evalutes to a char and in unicode, a wide char. Maybe that is what is happening. Also don't explicitly call the Wide versions of functions, the compiler will call the correct version for you. Just use SendMessage.
-
got it
ah thanks for the reply..i worked it out thou
needed to use GETTEXTEX to read from the rtf box