Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Send Unicode Characters

150 views
Skip to first unread message

Yogi Yang 007

unread,
Jun 12, 2008, 9:16:28 AM6/12/08
to
I want to send Unicode Characters to target software which is a Unicode
enabled software (MS Word).

I want to send this characters using SendMessage and/or PostMessage but
I am not able to send them.

I am currently using these in the following way:

SendMessage(sharedData[0], WM_CHAR, $2734, 0);

Any idea what's wrong with this?

TIA

Yogi Yang

Rob Kennedy

unread,
Jun 12, 2008, 11:27:20 AM6/12/08
to

That message says the scan code for the character is zero; is that correct?

Are you sure you're sending the message to the right window?

Wm_Char is normally generated by the receiving application in response
to wm_KeyDown messages when the recipient calls Translate message. Have
you tried sending the keystrokes to the window instead of the characters?

--
Rob

Yogi Yang 007

unread,
Jun 13, 2008, 7:30:32 AM6/13/08
to
Rob Kennedy wrote:
>>
>> SendMessage(sharedData[0], WM_CHAR, $2734, 0);
>>
>
> That message says the scan code for the character is zero; is that correct?
Yes the scan code is set to 0 on purpose.

>
> Are you sure you're sending the message to the right window?
>

Yes I am sending to the right window as the hooking mechanism that I
have implemented tracks change in focus and automatically updates
shareData[0] with the handle of the active control.

> Wm_Char is normally generated by the receiving application in response
> to wm_KeyDown messages when the recipient calls Translate message. Have
> you tried sending the keystrokes to the window instead of the characters?
>

Actually I am first sending the message

SendMessage(sharedData[0], WM_KEYDOWN, 1FFF0001, 0);

If I don't use this then some of the applications do not respond to
WM_CHAR send message. Don't know why

Then I am sending

SendMessage(sharedData[0], WM_CHAR, $2734, 0);


The above combination sends ANSI characters without any problem but not
UNICODE characters.

What to do?

Regards,

Yogi Yang

Patrick Kursawe

unread,
Jun 13, 2008, 9:04:39 AM6/13/08
to
Yogi Yang 007 wrote:
> I want to send Unicode Characters to target software which is a Unicode
> enabled software (MS Word).
>
> I want to send this characters using SendMessage and/or PostMessage but
> I am not able to send them.

I would guess that you have to use SendMessageW instead of SendMessageA or
it will not be interpreted as Unicode.

Excuse my curiosity, but why do you need to send keypress codes to an
application that allows as much COM automation as MS Office does?

HTH,

Patrick

Yogi Yang 007

unread,
Jun 14, 2008, 8:56:31 AM6/14/08
to
Patrick Kursawe wrote:
>
> I would guess that you have to use SendMessageW instead of SendMessageA
> or it will not be interpreted as Unicode.
>
> Excuse my curiosity, but why do you need to send keypress codes to an
> application that allows as much COM automation as MS Office does?
>

Actually I have a software (a keyboard mapper to allow users to type in
non English languages, esp. in Indic Languages on English keyboard
without activating or installing any Windows based language drivers,
keyboards, etc.) which is written in VB 6 and it sends Uncode
Keystrokes. I have managed to sell 8000+ copies of it in 10 years.

Now that I am switching from VB 6 to Delphi in a grand way, I also want
to convert this flagship software of mine into Delphi but unfortunately
there is nothing like SendKeys(w) of VB in Delphi's Pascal and because
of this I will have to use SendMessage API to do this. But I am not able
to send Unicode characters even if I use SendMessageW.

Regards,

Yogi Yang

0 new messages