delphi 金山词霸屏幕取词技术的介绍
朋友,先要导入 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.
相关文档:
uses WinInet;
procedure TForm1.Button1Click(Sender: TObject);
begin
if InternetGetConnectedState(nil, 0) then
ShowMessage('已连接')
else
ShowMessage('已断开');
end; ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Bu ......
利用内存流来判断文件的格式,其实判断文件的前几个字节就可以简单的判断这个文件是什么类型的文件。
procedure TFrm.CheckImgType(Sender: TObject);
var //声明变量
MyImage:TMemoryStream; //内存流对象
Buffer:Word;
i:integer;
beg ......