Page 1 of 1

SDK translated to Delphi

Posted: Sat Jul 05, 2014 5:27 am
by Jondisic
SDK translated to Delphi, does anyone have?
Share it, please.

Re: SDK translated to Delphi

Posted: Sat Aug 02, 2014 9:12 pm
by Jondisic
A small example for Delphi7 in attachment


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.


Pasted TestMain.pas contents here -void

Re: SDK translated to Delphi

Posted: Mon Aug 25, 2014 7:53 am
by journeyonmyway
Can this version work in Delphi XE6?

Re: SDK translated to Delphi

Posted: Mon Dec 22, 2014 11:28 am
by Kline777
I've test this example in XE3 and it didnt work. Is anyone working with this in newer versions?

Re: SDK translated to Delphi

Posted: Sun Jun 25, 2017 11:51 pm
by antekgla
Hi, I try to download the rar attachment... but sadly is corrupt.
I try with 7zip and Winrar but same result... corrupt

Anyone has the file?
Thanks in advance!

Re: SDK translated to Delphi

Posted: Tue Jul 09, 2019 2:38 am
by jinshaopu
:D why not put it on github?let's update the file :roll:

Re: SDK translated to Delphi

Posted: Tue Jul 09, 2019 7:19 am
by void
I've fixed the corrupted Everything_Delphi7_example.rar file, please try:

Everything_Delphi7_example.rar.

Re: SDK translated to Delphi

Posted: Tue Jan 14, 2020 10:15 am
by STest6905
what does the string mean?
Is this text to search? he’s not looking for anything from me ...
Everything_SetSearchA('restorator');

Re: SDK translated to Delphi

Posted: Tue Jan 14, 2020 2:27 pm
by STest6905
I figured out this problem. But there was another problem. Encoding. For some reason, I know how to do some cracking as a result ....

Image

Re: SDK translated to Delphi

Posted: Wed Jan 15, 2020 12:36 am
by void
Please use the Unicode version of the Everything SDK functions (the functions ending with W instead of A):

Re: SDK translated to Delphi

Posted: Wed Jan 15, 2020 6:36 am
by STest6905
Thanks, it's really help!!!

Re: SDK translated to Delphi

Posted: Thu Jan 16, 2020 12:41 pm
by Kajoj
Could anyone extend this example to use the Everything_GetResultSize function?
Thanks!

Re: SDK translated to Delphi

Posted: Wed Jan 22, 2020 12:57 am
by void
Please try:


function Everything_GetResultSize(index: DWORD,size: PInt64); stdcall; external 'Everything32.dll' name 'Everything_GetResultSize';

...

size: Int64;
Everything_GetResultSize(0,@size);


Re: SDK translated to Delphi

Posted: Thu Jan 23, 2020 9:38 pm
by Kajoj
Thanks for the tip, it works now :)
However, I had to add the Everything_SetRequestFlags function with EVERYTHING_REQUEST_SIZE parameter before Everything_QueryW.
Working code below:

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;  

Re: SDK translated to Delphi

Posted: Thu Oct 14, 2021 2:18 pm
by PeterPanino
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.
I've downloaded the archive and loaded the project in Delphi 11 Alexandria: When trying to compile it I got this warning:

Image

I selected Yes.

When running the program, I got this result:

Image

Re: SDK translated to Delphi

Posted: Mon Oct 18, 2021 7:30 am
by void
There appears to be some results found from the window caption changing to 4553484.

This suggestions Everything is searching for most of your files instead of the test string.

There might be a Character Set mismatch.
Please make sure you are compiling your application for ANSI (not unicode) or use the Unicode Everything functions ending with W (instead of A)