?? sysutil.dpr
字號:
{***********************************
* Plugin Sample *
* File Utilities v1.0 *
* by satan_addict *
***********************************}
library server_plugin;
uses
Windows,
sysutils,
classes,
shellapi;
type
pluginreply = procedure (Text: pchar);
var
clientdllname:pchar;
OwnerAPP:integer;
lololsdddddddddddddddddddddddddddddd:string;
procedure Init(Owner: Integer); far
begin
OwnerAPP := Owner;
end;
function CopyDir(const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_COPY;
fFlags := FOF_FILESONLY;
pFrom := PChar(fromDir + #0);
pTo := PChar(toDir)
end;
Result := (0 = ShFileOperation(fos));
end;
function MoveDir(const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_MOVE;
fFlags := FOF_FILESONLY;
pFrom := PChar(fromDir + #0);
pTo := PChar(toDir)
end;
Result := (0 = ShFileOperation(fos));
end;
function DelDir(dir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_DELETE;
fFlags := FOF_SILENT or FOF_NOCONFIRMATION;
pFrom := PChar(dir + #0);
end;
Result := (0 = ShFileOperation(fos));
end;
procedure RenameDir(DirFrom, DirTo: string);
var
shellinfo: TSHFileOpStruct;
begin
with shellinfo do
begin
Wnd := 0;
wFunc := FO_RENAME;
pFrom := PChar(DirFrom);
pTo := PChar(DirTo);
fFlags := FOF_FILESONLY or FOF_ALLOWUNDO or
FOF_SILENT or FOF_NOCONFIRMATION;
end;
SHFileOperation(shellinfo);
end;
procedure process(RString: string);
var dir1,dir2,file1,file2:string;
begin
//here you put the client plugin name:
clientdllname:='util.dll';
if (pos('newdir',RString)>0) then //newdir#dirpath
begin
Delete(RString,1,6);
dir1:=copy(RString,Pos('#',RString),length(RString));
Delete(dir1,pos('#',dir1),pos('#',dir1));
if CreateDir(dir1) then
//send message to the client plugin
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'Dir Created! '+ dir1))
else
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'Error!'));
end;
if (pos('removedir',RString)>0) then //removedir#dirpath
begin
Delete(RString,1,9);
dir1:=copy(RString,Pos('#',RString),length(RString));
Delete(dir1,pos('#',dir1),pos('#',dir1));
if deldir(dir1) then
//send message to the client plugin
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'Dir Removed! '+ dir1))
else
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'Error!'));
end;
if (pos('copydir',RString)>0) then //copydir#dir1
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -