给你两个函数.SetmyIme用于设置,ResetIme用于恢复.<br><br>procedure SetmyIme(ImeName:string);<br>var<br> I: Integer;<br> HandleToSet: HKL;<br>begin<br> if not SysLocale.FarEast then Exit;<br> if ImeName <> '' then<br> begin<br> if (AnsiCompareText(ImeName, Screen.DefaultIme) <> 0)<br> and (Screen.Imes.Count <> 0) then<br> begin<br> HandleToSet := Screen.DefaultKbLayout;<br> I := Screen.Imes.IndexOf(ImeName);<br> if I >= 0 then<br> HandleToSet := HKL(Screen.Imes.Objects);<br> ActivateKeyboardLayout(HandleToSet, KLF_ACTIVATE);<br> end;<br> end;<br>end;<br><br>procedure ResetmyIme(ImeName:string);<br>begin<br> if not SysLocale.FarEast then Exit;<br> if ImeName <> '' then<br> begin<br> if AnsiCompareText(ImeName, Screen.DefaultIme) <> 0 then<br> ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);<br> end;<br>end;<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> SetmyIme('输入法');<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> ResetmyIme('输入法');<br>end;<br><br>我找到了。