p;
procedureTForm1.closeime;varmyhkl:hkl;beginmyhkl:
=GetKeyBoardLayOut(0);ifImmIsIME(myhkl)then //
判断是否在中文状态,若是则关闭它immsimulateHotkey(handle,IME_CHotKey_IME_NonIME_Toggle);end;
procedureTForm1.ComboBox1Change(Sender:TObject);
beginOpenIme(ComboBox1.Text);end;
procedureTForm1.BitBtn1Click(Sender:TObject);
beginimmsimulateHotkey(handle,IME_CHotKey_shape_Toggle);//
切换半角和全角模式end;
procedureTForm1.BitBtn2Click(Sender:TObject);
beginimmsimulateHotkey(handle,IME_CHotKey_symbol_Toggle);
//
切换中文标点模式和英文标点模式end;
procedureTForm1.BitBtn3Click(Sender:TObject);
begincloseime;end;
end.
本
程序在Delphi3.0/4.0下通过。