1. After calling Getkeyboardlayout to get the IME hkl, look in the registry for the IME name (take Notepad as an example) HWnd = Wingethandle ("Classname=notepad")
Keystr=getkeyboardlayout ($HWND)
Keyname=regread ("Hkey_local_machine/system/currentcontrolset/control/keyboard Layouts/" & $KeyStr, "Layout Text ")
2. Call Getkeyboardlayout and immgetdescription for both functions
3.ImmGetConversionStatus (Immgetcontext (GetForegroundWindow), B)
4.TID: = GetWindowThreadProcessId (GetForegroundWindow, @PID);
MYHKL: = Getkeyboardlayout (TID);
5. Tscreen class-Get the current input method and Input method list
//Get Input Method list begin Memo1.lines: = Screen.imes;
End ;
Gets the current input method var KL:HKL;
I:integer;
begin KL: = getkeyboardlayout (0 ); for i: = 0 to screen.imes.count-1 Do if HKL (screen.imes.objects[i]) = KL then ShowMessage (screen.imes.strings[i]); {Show Current IME}
End ;