implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
II := 0;
//retrieves the keyboard layout handles corresponding to the current set of input locales in the system.
iHandleCount := GetKeyboardLayoutList(20, pList);
for i := 1 to iHandleCount do
begin
if ImmEscape(pList[i], 0, IME_ESC_IME_NAME, @szImeName) > 0 then
if szImeName=’微软拼音输入法’ then
begin
ii := i;
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/