SDK translated to Delphi
Posted: Sat Jul 05, 2014 5:27 am
SDK translated to Delphi, does anyone have?
Share it, please.
Share it, please.
unit TestMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, VirtualTrees, XPMan, ImgList;
type
TForm1 = class(TForm)
btn1: TButton;
VST1: TVirtualStringTree;
xpmnfst1: TXPManifest;
il1: TImageList;
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
procedure VST1GetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var ImageIndex: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//==============================================================================
const
Dll = 'Everything32.dll';
procedure Everything_SetSearchA(lpString: LPCTSTR); stdcall; external Dll index 35;
procedure Everything_QueryA(bWait: BOOL); stdcall; external Dll index 25;
function Everything_GetNumResults: DWORD; stdcall; external Dll index 8;
function Everything_GetResultFileNameA(index: DWORD): LPCTSTR; stdcall; external Dll index 13;
function Everything_GetResultPathA(index: DWORD): LPCTSTR; stdcall; external Dll index 15;
function Everything_IsFolderResult(index: DWORD): BOOL; stdcall external Dll index 23;
//=============================================================================
procedure TForm1.FormCreate(Sender: TObject);
begin
btn1.Click;
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
Everything_SetSearchA('restorator');
Everything_QueryA(True);
VST1.RootNodeCount := Everything_GetNumResults;
Caption := IntToStr(VST1.RootNodeCount);
end;
procedure TForm1.VST1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
begin
case TextType of
ttNormal:
case Column of
0: CellText := Everything_GetResultFileNameA(Node.Index);
1: CellText := Everything_GetResultPathA(Node.Index);
end;
ttStatic:;
end;
end;
procedure TForm1.VST1GetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var ImageIndex: Integer);
begin
case Kind of
ikNormal,ikSelected:
case Column of
0: if Everything_IsFolderResult(Node.Index) then
ImageIndex := 0;
end;
end;
end;
end.
Everything_SetSearchA('restorator');
function Everything_GetResultSize(index: DWORD,size: PInt64); stdcall; external 'Everything32.dll' name 'Everything_GetResultSize';
...
size: Int64;
Everything_GetResultSize(0,@size);
Code: Select all
const
EVERYTHING_REQUEST_FILE_NAME = $1;
EVERYTHING_REQUEST_SIZE = $10;
procedure Everything_SetRequestFlags(dwRequestFlags:DWORD); stdcall; external 'Everything32.dll' name 'Everything_SetRequestFlags';
...
Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME + EVERYTHING_REQUEST_SIZE);
Everything_QueryW(True);
for i:=0 to Everything_GetNumResults() - 1 do
begin
Memo1.Lines.Add(WideCharToString(Everything_GetResultFileNameW(i)));
Everything_GetResultSize(i, @size);
Memo1.Lines.Add(intToStr(size));
end;
I've downloaded the archive and loaded the project in Delphi 11 Alexandria: When trying to compile it I got this warning:void wrote: ↑Tue Jul 09, 2019 7:19 am I've fixed the corrupted Everything_Delphi7_example.rar file, please try:
Everything_Delphi7_example.rar.