IME Support

Post your new features ideas and suggestions here.
Post Reply
naoky

IME Support

Post by naoky »

Do you have a plan to support IME (Input Method Editor) in the internal editor?
It is very important for East Asian users whether application is IME-aware or not.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Hmm, in fact I believed it is Windows that supports IME in any editor. I will study documentation on this topic again.

Steve Squires

Japanese IME

Post by Steve Squires »

Japanese IME works great with CompareIt on my Windows XP system.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Thank you for information, Steve!

naoky

Re: Japanese IME

Post by naoky »

Steve Squires wrote:Japanese IME works great with CompareIt on my Windows XP system.
Not so great on my Windows XP system. :cry:

You can use IME and input Japanese characters, if you don't mind the IME composition window pops up outside the editor window. But Asian users expect that IME composition window would be directly shown in the editor window.

I'm afraid whether I could explain the issue. If you have Japanese (or any other Asian version) Windows, please use IME in Notepad. You will understand what I say.

I hear that "IME-aware" application must handle some IME/IMM window messages and call IME/IMM related APIs properly. I'm sorry I don't know much about these. Please refer to MSDN.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Now I see, thank you for information. I have also seen this additional IME editor window, and was believing this is OK. I will study the problem further.

naoky
Posts: 4
Joined: Tue Feb 07, 2006 1:30 pm
Location: Japan

IME Support

Post by naoky »

Sorry for my delayed reply.
I have known recently something about IME control, I write them here.
Probably the most important point is that your unicode version of CompareIt! process WM_IME_STARTCOMPOSITION message. The message handler will become like this:

Code: Select all

  // WM_IME_STARTCOMPOSITION message handler

  // Get IME context handle.
  // "hWnd" is HWND handle of your editor control.
  HIMC hImc = ImmGetContext( hWnd );
  if ( hImc ) {
    // Set IME composition font.
    // "lfLogFont" is LOGFONTW structure of your editor control.
    ImmSetCompositionFontW( hImc, &lfLogFont );

    // Set IME composition window position.
    // "ptCurPos" is POINT structure of current caret position in your editor control.
    COMPOSITIONFORM cfCompForm;
    cfCompForm.dwStyle = CFS_POINT;
    cfCompForm.ptCurrentPos = ptCurPos;
    ImmSetCompositionWindow( hImc, &cfCompForm );

    // Release IME context handle.
    // "hWnd" is HWND handle of your editor window.
    ImmReleaseContext( hWnd, hImc );
  }
Don't forget include "imm.h".

Perhaps this will work. If not, something may lack. I will continue learning about IME control.
If you can't experiment whether this will work or not, I will test it instead of you. Would you please send me alpha version of CompareIt! if possible? (I am a registerd user. The registered name is "Naoki Tanaka".)

Thanks in advance.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Thank you for help. At that time I have put IME support aside for a while, but since you can help me, I will try to implement it. I will now refresh what I have lerned about IME in MSDN and try to implement what I can. I will notify you here and by email, when I will have something to test.

naoky
Posts: 4
Joined: Tue Feb 07, 2006 1:30 pm
Location: Japan

Post by naoky »

Thank you very much!
I'm looking forward to try it! :D

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

OK, seems like you are right - I was able to setup IME on work PC, and can see the difference now. Your code is sufficient, from my point of view.
You can check it here - http://www.grigsoft.com/wincmp3bu.zip.

naoky
Posts: 4
Joined: Tue Feb 07, 2006 1:30 pm
Location: Japan

Post by naoky »

Great! It works fine so far.

But... there is an issue to be improved: (Don't say I'm nervous...)
Height of IME composition window is a little bigger than usual line. Would you please change the part of setting IME composition window position as follows:

// Set IME composition window position.
// "ptCurPos" is POINT structure of current caret position in your editor control.
COMPOSITIONFORM cfCompForm;
cfCompForm.dwStyle = CFS_FORCE_POSITION; // Change from CFS_POINT
cfCompForm.ptCurrentPos = ptCurPos;
ImmSetCompositionWindow( hImc, &cfCompForm );

I don't test this code, but I would like to examine it because of the description of Win32 SDK Help file. Please try it if you have time.

Thanks.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Yes, I have noticed that too. But I have even tried to use CFS_RECT wihtout any success. The problem is Compare It! tries to make line height minimal to show more on single page, and Windows consider this height is not enough.

naoky
Posts: 4
Joined: Tue Feb 07, 2006 1:30 pm
Location: Japan

Post by naoky »

Hmm... IME behaves in mysterious way...
Away from IME support issue, why don't you make a margin for line height? I think it's better that line height margin is optional.

Post Reply