孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

procedure CloseEDTIME(edt: TEdit);

var

  KeyStates: TKeyboardState;

begin

  GetKeyboardState(KeyStates);

  if (KeyStates[VK_CAPITAL] = 1) then

  begin

    SetCapsLockKey(VK_CAPITAL, TRUE); //关大写

  end;

  Closeime(edt.Handle);

end;

procedure OpenEDTIME(edt: TEdit);

var

  KeyStates: TKeyboardState;

begin

  GetKeyboardState(KeyStates);

  if (KeyStates[VK_CAPITAL] = 1) then

  begin

    SetCapsLockKey(VK_CAPITAL, TRUE); //关大写

  end;

  edt.ImeMode := imChinese;

  edt.ImeName := ShareGlobalVar.GlobalVar.GetImeName;

  edt.ImeMode := imOpen;

end;

procedure GetDicIME(edt: TEdit);

var

  KeyStates: TKeyboardState;

begin

  GetKeyboardState(KeyStates);

  if (KeyStates[VK_CAPITAL] = 0) then

  begin

    SetCapsLockKey(VK_CAPITAL, TRUE); //开大写

  end;

  Closeime(edt.Handle);              //关输入法

end;

procedure OpenCMBIME(cmb:TComboBox);

var

  KeyStates: TKeyboardState;

begin

  GetKeyboardState(KeyStates);

  if (KeyStates[VK_CAPITAL] = 1) then

  begin

    SetCapsLockKey(VK_CAPITAL, TRUE); //关大写

  end;

  cmb.ImeMode := imChinese;

  cmb.ImeName := ShareGlobalVar.GlobalVar.GetImeName;

  cmb.ImeMode := imOpen;

end;

procedure CloseCapital;

var

  KeyStates: TKeyboardState;

begin

  GetKeyboardState(KeyStates);

  if (KeyStates[VK_CAPITAL] = 1) then

  begin

    SetCapsLockKey(VK_CAPITAL, TRUE); //关大写

  end;

end;

posted on 2010-05-14 14:21  孤独的猫  阅读(771)  评论(0编辑  收藏  举报