tags:

views:

260

answers:

2

I am trying to make our application properly handle international input. Since we handle text input and font rendering ourselves, I wrote custom code to handle the respective WM_IME_* messages.

Now, this all works fine, with one exception: When our applications main window is open, the Language Bar will not let me pick any options. I can set the input language to Japanese or Korean, but the menus for choosing the input methods (like Hangul or Hiragana) are not shown. Then, when I open another window (any other window, be it one of our application windows, or a standard "save file" dialog), the options appear. Once there, they will stay, even if I close the other window. IME input will then work as expected in the main window. But, as explained, only if I open another window first.

Now, how does windows decide whether it should display the input method options or not? It appears that windows does not recognize our main window as Unicode capable for some reason. How can I fix that?

Thanks in advance for any suggestions,

jonas

Edit: One more strange thing i noticed is that for my main window (which will not let me change input methods), I will get a WM_INPUTLANGUAGECHANGEREQUEST message when i change the input language - which I pass on to DefaultWindowProcW. For the windows which let me change the input method, i don't get the request, i just get a WM_INPUTLANGUAGECHANGE message (which I don't get for the other window).

A: 

Some notes

  • Text Service is works per window, not system wide, so even its turn on in one window, another window will still need to turn it on, (unless user set it as default)

  • And Text Service is not working in any windows, to enable that, target computer need to enable following setting on

    alt text

S.Mark
I am aware of the input method being set per window. My problem is that the system will not recognize my applications main window as being IME aware (even though it is), until i open another window. So, how does the system determine whether Text Services can be enabled for a window or not?Changing that preference in Text Services and Input Languages has no effect.
jonas echterhoff
What kind of text box is using in your application? could you add that and add some more info in your question and bump it. other people could notice the question and could able to answer it.
S.Mark
As i wrote in the question - we handle text input and font rendering ourselves, (think of an interactive 3d application) so there is no text box, at least not in the sense of a windows-supplied UI control. Not sure what other info it would make sense to supply? The part I don't understand is that it works for some windows but not others - so I need to know how Windows decides if a window is IME capable or not.
jonas echterhoff
According to TSF Architecture http://msdn.microsoft.com/en-us/library/ms538050(VS.85).aspx, its only available on COM Server communicatable applications, I am afraid I am not sure, It could be done on Custom Text Input UI or not.
S.Mark
Yes, generally, implementing custom IME input handling is possible, as described here: http://msdn.microsoft.com/en-us/library/ee419002(VS.85).aspx
jonas echterhoff
A: 

Ok, after a long search I've been able to find out what is breaking this. We are calling SetFocus on a child window in response to WM_FOCUS messages, so that a specific child window always gets focused when a window is brought to the front. Apparently, this confuses window's IME code, and makes it unaware that the window can handle IME input.

jonas echterhoff