Attachement is the modifed patch.
??????: "Albert"<address@hidden>;
????????: 2020??4??13??(??????) ????3:26
??????: "Eli Zaretskii"<address@hidden>;
????: "emacs-devel"<address@hidden>;
????: ?????? ?????? ?????? ?????? ?????? [PATCH] Add IME status change support on windows natively
I can't get the main window handle as emacs doesn't save the main window handle after invoking createWindow(). I just found w32_system_caret_hwnd did work. I will modify the code by using GetFocus().
------------------ ???????? ------------------
??????: "Eli Zaretskii"<address@hidden>;
????????: 2020??4??13??(??????) ????3:21
??????: "Albert"<address@hidden>;
????: "emacs-devel"<address@hidden>;
????: Re: ?????? ?????? ?????? ?????? [PATCH] Add IME status change support on windows natively
> From: "Albert" <address@hidden>
> Cc: "emacs-devel" <address@hidden>
> Date: Mon, 13 Apr 2020 15:07:19 +0800
>
> Thanks. I'll try it.
I'm also worried by your use of w32_system_caret_hwnd as the handle of
the window for which to retrieve the input context.
w32_system_caret_hwnd is not guaranteed to be a valid handle if the
system caret is not used, i.e. if w32-use-visible-system-caret is nil
(which is the default).
So perhaps instead of using w32_system_caret_hwnd, you should use the
return value of GetFocus function, similar to what we do elsewhere in
w32_msg_pump.