用screen对象吧
这是在网上找到的:
for i:=0 to Screen.Imes.Count-1 do//获取系统输入法清单
lsbxImes.Items.Add(Screen.Imes.Strings);
Procedure OpenIme(ImeName:string) ;//打开指定的输入法
var
i:Integer;
myhkl:hkl;
begin
if Trim(ImeName)<>'' then
begin
if Screen.Imes.Count<>0 then
begin
i:=Screen.Imes.IndexOf(ImeName);
if i>=0 then
myhkl:=hkl(Screen.Imes.Objects);
ActivateKeyBoardLayOut(myhkl,KLF_ACTIVATE);
end;
end;
end;
Procedure CloseIme;//关闭输入法
var
myhkl:hkl;
begin
myhkl:=GetKeyBoardLayOut(0);
if ImmIsIME(myhkl) then
ImmsimulateHotKey(Handle,IME_cHotKey_IME_NonIME_Toggle);
end;