朋友,先要导入 XDICTGRB_TLB ,然后用下面的source,注意TForm1 = class(TForm,IXDictGrabSink) //!!!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleServer, XDICTGRB_TLB;
type
TForm1 = class(TForm,IXDictGrabSink) //!!!
GrabProxy1: TGrabProxy;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function QueryWord(const WordString: WideString;lCursorX: Integer;
lCursorY: Integer;const SentenceString: WideString;
var lLoc: Integer; var lStart: Integer): Integer; safecall;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
GrabProxy1.GrabInterval :=1;
GrabProxy1.GrabMode :=XDictGrabMouse;
GrabProxy1.GrabEnabled :=true;
GrabProxy1.AdviseGrab(self);
end;
function TForm1.QueryWord(const WordString: WideString; lCursorX,
lCursorY: Integer; const SentenceString: WideString; var lLoc,
lStart: Integer): Integer;
begin
memo1.Text := memo1.text+SentenceString+#13#10;
end;
end.
delphi 金山词霸屏幕取词技术的介绍
最新推荐文章于 2020-12-02 06:04:35 发布