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;
            }
        }
    }

  • 相关阅读:
    C# 关于类的事件和委托
    C# 多态
    C# 声明方法的语法
    C# 面向对象基础
    近期发现的一些.net资源
    asp.net 2.0学习资源
    设置VSS使支持通过Internet访问
    大型社区设计:提高用户体验的10个细节
    委托的用法
    有滚动条、固定Header的ASP.Net DataGrid实现
  • 原文地址:https://www.cnblogs.com/chenfulai/p/692409.html
Copyright © 2011-2022 走看看