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