commit
61da72 is different from commit c6ecda. We don't need to get IME status before setting IME status. If IME is the same status when setting it in the same status, IME will ignore the status changing. Emacs can be a litttle bit faster if get_ime_open_status_fn() is not invoked.
And IME somtimes doesn't fully comply with Microsoft IME api, RIME for example. RIME which is a open source chinese ime doesn't return the status as Microsoft pinyin IME. When Microsoft pinyin IME is activated, if Microsoft pinyin is in english mode, w32-get-ime-open-status() return nil. If Microsoft pinyin is in chinese mode, w32-get-ime-open-status() return t. We can press <SHIFT> to switch between two modes by default.
When RIME is activated, w32-get-ime-open-status() return t whenever IME is in english mode or chinese mode.
I modified code in w32-get-ime-open-status(). w32-get-ime-open-status() can get the status from IME.
------------------ ???????? ------------------
??????: "Eli Zaretskii"<address@hidden>;
????????: 2020??4??13??(??????) ????9:44
??????: "Albert"<address@hidden>;
????: "emacs-devel"<address@hidden>;
????: Re: [PATCH] Add IME status change support on windows natively
> From: "Albert" <address@hidden>
> Date: Mon, 13 Apr 2020 21:15:16 +0800
> Cc: emacs-devel <address@hidden>
>
> Thanks for your help. I will follow the emacs coding standard in the future.
Thanks, please try the latest master branch, I've modified the code a
little. In particular, w32-get-ime-open-status now returns nil or t,
not 0 or 1.