请问哪位高手有屏幕取词的源代码~`就好像金山词霸那个一样```类似相关的源代码也行`~``急需````先谢了``

解决方案 »

  1.   

    具体源码没有,思路是取相应屏幕坐标的信息后用windows消息发送。程序再捕获这个消息。
      

  2.   

    大概如下吧:
    获取鼠标屏幕区域,然后重绘该区域,利用钩子获取某应用程序的DrawText API调用,并且重写覆盖该API,获取DrawText的文本内容,就这样了.怎么样用钩子,好好琢磨下 windows核心编程.
      

  3.   

    用的是金山词霸里面的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;
            }
        }
    }
      

  4.   

    请参考:专业屏幕取词引擎 - GetWord, http://www.textcapture.com/