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使用win32api截图并回收资源
    tesseract-ocr的安装及使用
    python识别图片文字
    Python中CreateCompatibleDC和CreateBitmap造成的内存泄漏
    Python调用windows API实现屏幕截图
    turtle库常用函数
    Python3.6安装turtle模块
    Python中的截屏模块 pyscreenshot
    Python实现屏幕截图的两种方式
    观察者模式(Observer Pattern)
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2035709.html
Copyright © 2011-2022 走看看