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.
Ïà¹ØÎĵµ£º
ȷʵºÜÓÐÓ㬵«ÊÇÕâ¸öÔõô°Ñ¿Õ¸ñҲĬÈÏΪ·Ö¸î·ûÁËÄØ£¬ËÖªµÀÔõÑù°Ñ¿Õ¸ñ²»ÈÏΪÊÇ·Ö¸î·ûµÄ£¿£¿ TStringsÊÇÒ»¸ö³éÏóÀ࣬ÔÚʵ¼Ê¿ª·¢ÖУ¬ÊdzýÁË»ù±¾ÀàÐÍÍ⣬ӦÓõÃ×î¶àµÄ¡£ ³£¹æµÄÓ÷¨´ó¼Ò¶¼ÖªµÀ£¬ÏÖÔÚÀ´ÌÖÂÛËüµÄһЩ¸ß¼¶µÄÓ÷¨¡£ ÏÈ°ÑÒªÌÖÂ۵ļ¸¸öÊôÐÔÁгöÀ´£º 1
ȷʵºÜÓÐÓ㬵«ÊÇÕâ¸öÔõô°Ñ¿Õ¸ñҲĬÈÏΪ·Ö¸î·ûÁËÄØ£¬ËÖªµÀÔõÑ ......
1.·ÀֹˢÐÂʱÉÁ˸µÄÖÕ¼«½â¾ö°ì·¨
{ ·ÀֹˢÐÂʱÉÁ˸µÄÖÕ¼«½â¾ö°ì·¨(¶Ô¸¶Ë«»º³åÎÞЧʱ) }
Perform($000B, 0, 0); //ËøÆÁÄ» ·ÀÖ¹ÉÁ˸
// ×öһЩ»á·¢ÉúÑÏÖØÉÁ˸µÄÊÂÇé..
//½âËøÆÁÄ»²¢ÖØ»
Perform($000B, 1, 0);
& ......
ÔÚȺÀï¿´µ½ÓÐÈË·¢Á˸ö±ðÈË·¢¸øËûµÄ
ÎÒ¿´ÁËдµÄ±È½ÏÉú¶¯ ÔÚÕâת¸ø´ó¼Ò¿´¿´
ºÃµÄ Ê°È¡ÎïÌ庯ÊýдºÃÁË Ï²½ÊÇÈçºÎ½«´úÂë×¢Èëµ½ÓÎÏ·½ø³ÌÖÐÖ´ÐÐ??
1) С͵¿ªÃÅ
PHND:= OpenProcess (PROCESS_ALL_ACCESS, False, PID);µÃµ½ÓÎÏ·´°¿Ú¾ä±ú»ñµÃȨÏÞ
2)С͵ÔÚ·¿¼ä¸ã¸ö·Å×÷°¸·½°¸µÄµØ·½
TAdd := VirtualAllocEx(PHND, nil, 4096, ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
&n ......
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TDemoForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GetButton: TBitBtn;
CloseButton: TBitBtn;
Bevel1: TBevel;
Label5: TLabel;
......