The ImmGetOpenStatus function checks whether the IME is open or closed.
BOOL WINAPI ImmGetOpenStatus(
HIMC hIMC
);
The return value is a nonzero value if the IME is open, and zero otherwise.