Hi everybody,
I am writing a single-line richedit control that the user can enter some search words into and then press enter to start the search. At the moment I have sent an EM_SETEVENTMASK message with ENM_KEYEVENTS, handle the keystrokes and look for a VK_RETURN. However, when I use an IME (Input Method Editor) in say Japanese and enter some text and then convert it (from romaji into hiragana and kanji) by pressing enter, it receives a VK_RETURN too. Is there anyway I can stop this from happening, perhaps by working out if the IME is still composing when enter is pressed, or using dialog boxes or something? Does anybody know any other way of responding to a enter in the richedit control without using EM_SETEVENTMASK? Thanks.
Posted on 2004-11-06 00:53:51 by StefanD

I have no way of testing a rich edit control using the IME technique but if you can acces characters as they are typed you can process what you allow and what you do not with a subclass on the edit control processing the WM_CHAR message.

Just test the wParam of the WM_CHAR and you can accept it or return zero if you don't.
Posted on 2004-11-06 05:31:57 by hutch--
It okay, I've figured out the solution. When you press enter and finish composition in the IME, the IME sends a WM_KEYUP but not a WM_KEYDOWN message for 'enter', so I changed that and it works. By the way I'm working on a dictionary searcher for foreign languages and also for english using the international phonetic alphabet.
Posted on 2004-11-06 06:00:39 by StefanD