zoukankan      html  css  js  c++  java
  • 屏幕取词

    用的是金山词霸里面的dll
    在金山词霸中2005中带了一个XdictGrb.dll,添加引用

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Text;
    using System.Windows.Forms;
    using XDICTGRB;//金山词霸组件

    namespace WindowsApplication1
    {
        public partial class Form1 : Form,IXDictGrabSink
        {
            public Form1()
            {
                InitializeComponent();
            }
            private void Form1_Load(object sender, EventArgs e)
            {
                GrabProxy gp = new GrabProxy();
                gp.GrabInterval = 1;//指抓取时间间隔
                gp.GrabMode = XDictGrabModeEnum.XDictGrabMouse;//设定取词的属性
                gp.GrabEnabled = true;//是否取词的属性
                gp.AdviseGrab(this);
            }
            //接口的实现
            int IXDictGrabSink.QueryWord(string WordString, int lCursorX, int lCursorY, string SentenceString, ref int lLoc, ref int lStart)
            {
                this.textBox1.Text = SentenceString;//鼠标所在语句
                //this.textBox1.Text = SentenceString.Substring(lLoc + 1,1);//鼠标所在字符
                return 1;
            }
        }
    }

  • 相关阅读:
    Java 中常用缓存Cache机制的实现
    Spring普通类获取bean
    系统升级shell
    shell 操作文本内容(修改增加)
    接口实践;接口与抽象类
    Java中@Override的作用
    类实现多个接口的例子
    java 反射实践
    对象主要属性及识别
    java抽象类实践
  • 原文地址:https://www.cnblogs.com/chenfulai/p/692409.html
Copyright © 2011-2022 走看看