zoukankan      html  css  js  c++  java
  • 打开和关闭输入法

    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;

  • 相关阅读:
    Python 15 爬虫(一)
    Python 14 Mysql数据库(二)
    Python 13 JQuery&Bootstrp
    Python 12 CSS&JavaScript&DOOM
    Python 11 HTML
    Python 10 MySQL数据库(一)
    Python 9 Redis
    Python 8 协程
    Python 7 并发编程
    SNMP协议详解
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2035709.html
Copyright © 2011-2022 走看看