hedx is ok.
uses
imm;
function GetImeFileName: string;
var
szImeFileName: array[0..MAX_PATH] of char;
begin
if ImmGetIMEFileName(GetKeyboardLayout(0), szImeFileName, MAX_PATH) <> 0 then
Result := AnsiUpperCase(StrPas(szImeFileName))
else
Result := '';
end;