WM_UNICHAR messages not recieved

6 views
Skip to first unread message

Lewis G. Pringle, Jr.

unread,
Jan 14, 2003, 10:24:18 AM1/14/03
to
I've been trying to add WM_UNICHAR support to my application, and I
think I've followed all the SDK instructions. My problem is that I never
seem to actually GET any WM_UNICHAR messages. I'm running on WinXP, and I've
tried typing with several different keyboards and IMEs etc. Any hints?

Lewis.


Kobi Ben Tzvi

unread,
Jan 14, 2003, 3:11:03 PM1/14/03
to
Hi,
Did you define _UNICODE ?
WM_UNICHAR is only received when _UNICODE is defined, otherwise you will
get WM_CHAR.

--
Regards,
Kobi Ben Tzvi


"Lewis G. Pringle, Jr." <le...@sophists.com> wrote in message
news:OhJj4D#uCHA.2544@TK2MSFTNGP11...

Lewis G. Pringle, Jr.

unread,
Jan 14, 2003, 5:20:21 PM1/14/03
to
Are you sure? Then what is the point of WM_UNICHAR? WM_CHAR already
returns a UNICODE character?

I'm trying to create an application that can run on Win9x (even if this
message can only be received on Win XP). You (basically) cannot build a
UNICODE (-D_UNICODE) app for Win9x (I think about MLU - but I'm not using
that).

This really makes no sense to me.

Lewis.

"Kobi Ben Tzvi" <tsum...@hotmail.comREMOVETHIS> wrote in message
news:#QXKIkAvCHA.2304@TK2MSFTNGP10...

Kobi Ben Tzvi

unread,
Jan 15, 2003, 7:54:00 AM1/15/03
to
Hi,
You are right, my suggestion makes no sense.
I would suggest reading this post
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3ae1aff3
_2%40dnews&rnum=1&prev=/groups%3Fq%3DUNICODE_NOCHAR%26hl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3DUTF-8%26selm%3D3ae1aff3_2%2540dnews%26rnum%3D1
let me know if it resolved your problem.

--
Regards,
Kobi Ben Tzvi


"Lewis G. Pringle, Jr." <le...@sophists.com> wrote in message

news:#7NGYsBvCHA.2028@TK2MSFTNGP11...

FL

unread,
Jan 15, 2003, 8:05:49 AM1/15/03
to
Hmm... but according to what he says, he is not receiving *any*
WM_UNICHAR message at all. Perhaps, it requires an IME that produces
higher plane Unicode codepoints to test this.

Francisco

Lewis G. Pringle, Jr.

unread,
Jan 15, 2003, 9:41:49 AM1/15/03
to
Thanks. I've read these already. I tried a google search before posting
to the net.

The various postings I've seen make it seem like WM_UNICHAR only works
for UNICODE windows. But - that would appear to be almost TOTALLY useless
(since again - WM_CHAR does that).

If the only difference is that for surrogates - you can get one message
instead of two - whats the big deal? In order to render the characters - you
ahve to convert the one 32-bit char to 2 16-bit ones anyhow because the
entire Win32 API is based on 16-bit UNICODE chars.

I just don't get it.

AND - this then begs the REAL question. Suppose I have an application
that wants to talk UNICODE. It uses MFC (and therefore either has to be a
full UNICODE app (-D_UNICODE) or NOT a full UNICODE app. If its NOT a full
UNICODE app then it cannot have any UNICODE windows (and MFC limitation). If
it IS a full UNICODE app - the binary won't run on Win9x (without MLU).

What a mess!!!!

Lewis.

"Kobi Ben Tzvi" <tsum...@hotmail.comREMOVETHIS> wrote in message

news:Or2JkUJvCHA.848@TK2MSFTNGP11...

Jian-Shen Lin[MS]

unread,
Apr 15, 2003, 11:49:31 PM4/15/03
to
Currently says the following which is incorrect.
The WM_UNICHAR message is posted to the window with the keyboard focus when
a WM_KEYDOWN message is translated by the TranslateMessage function. The
WM_UNICHAR message contains the character code of the key that was pressed.
The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode
transformation format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed
to send or post Unicode characters to ANSI windows and it can can handle
Unicode Supplementary Plane characters.

It should say something like:

The WM_UNICHAR message can be used by an application to post input to other
windows. The WM_UNICHAR message contains the character code of the key that
was pressed. Sending this message with the wParam set to UNICODE_NOCHAR as
specified below can be used to test if the target app can process these
messages.
The WM_UNICHAR message is similar to WM_CHAR, but it uses Unicode
transformation format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed
to send or post Unicode characters to ANSI windows and it can can handle
Unicode Supplementary Plane characters.


WM_UNICHAR documentation is wrong. This message is not generated by the
OS, but by
other applications ( such as Office).

Best Regards

Jian Shen

This posting is provided "AS IS" with no warranties, and confers no rights.

Reply all
Reply to author
Forward
0 new messages