调用:<br> ToChinese(Edit1.Handle, True);<br><br>procedure ToChinese(Handle: THandle; bChinese: Boolean = True);<br>var<br> bActivated: Boolean;<br> iLastIme: Integer;<br>begin<br> bActivated := False;<br> if bChinese then<br> begin<br> iLastIme := Screen.Imes.IndexOf('你的写字板输入法名');<br> if iLastIme >= 0 then<br> begin<br> ActivateKeyboardLayout(HKL(Screen.Imes.Objects[iLastIme]), 0);<br> ImeModeSymbolAndNoFullShape(Handle);<br> bActivated := True;<br> end;<br> bFirstUseIme := False;<br> end;<br> if not bActivated and<br> (ImmIsIME(GetKeyboardLayOut(0)) <> bChinese) then<br> ImmSimulateHotKey(Handle, IME_CHotKey_IME_NonIME_Toggle);<br> Application.ProcessMessages; //Make sure the job is done<br>end;<br><br><br>-----<br>http://www.8421.org