?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
iReplace = procedure (Text: PChar);
TForm1 = class(TForm)
Button1: TButton;
Memo2: TMemo;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure getowner(owner:integer);
procedure Button1Click(Sender: TObject);
procedure send_cmd(cmd:string);
function getvalues(text:string;vn:integer):string;
procedure process(cmd:string);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
//this is the server plugin dll name:
serverdllname:pchar='internet.dll';
var
Form1: TForm1;
ownerapp:integer;
implementation
{$R *.dfm}
//Gets the EXE owner
procedure tform1.getowner(owner:integer);
begin
ownerapp:=owner;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
//allways on top:
{SetWindowPos(Handle, // handle to window
HWND_TOPMOST, // placement-order handle
Left, // horizontal position
Top, // vertical position
Width,
Height,
// window-positioning options
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); }
end;
// Separates values: value1,value2,value3,value4,
function TForm1.getvalues(text:string;vn:integer):string;
var i:integer;value:string;
begin
// value1,value2,value3,value4
if text=''then exit;
i:=0;
while i<vn do begin
value:=copy(text,0,Pos(',',text)-1);
//deletes first postition ','
Delete(text,1,pos(',',text));
inc(i,1);
result :=value;
end;
end;
procedure TForm1.process(cmd:string);
begin
memo2.Lines.Add(getvalues(cmd,1));
//memo1.Lines.Add(getvalues(cmd,2));
//memo1.Lines.Add(getvalues(cmd,3));
end;
procedure TForm1.send_cmd(cmd:string);
begin
//here you tell the client what to send to server:
iReplace(GetProcAddress(OwnerApp, 'ReplaceText'))(pchar(serverdllname+';'+cmd));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
memo2.Clear;
send_cmd('get,');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
memo2.Clear;
send_cmd('url,');
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -