日期:2014-05-18 浏览次数:21233 次
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using XDICTGRB; using CBGrabProxyLib; namespace WindowsFormsApplication3 { public partial class Form1 : Form, IXDictGrabSink /* ICBGrabSink */ { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { GrabProxy gp = new GrabProxy(); gp.GrabInterval = 2;//指抓取时间间隔 gp.GrabMode = XDICTGRB.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.Substring(lLoc + 1,1);//鼠标所在字符 //Console.WriteLine(SentenceString); this.textBox1.Text = SentenceString; return 1; } } }