SDK translated to Delphi

Plug-in and third party software discussion.
Post Reply
Jondisic
Posts: 11
Joined: Tue Jul 01, 2014 1:43 pm

SDK translated to Delphi

Post by Jondisic » Sat Jul 05, 2014 5:27 am

SDK translated to Delphi, does anyone have?
Share it, please.

Jondisic
Posts: 11
Joined: Tue Jul 01, 2014 1:43 pm

Re: SDK translated to Delphi

Post by Jondisic » Sat Aug 02, 2014 9:12 pm

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
You do not have the required permissions to view the files attached to this post.

journeyonmyway
Posts: 1
Joined: Mon Aug 25, 2014 5:55 am

Re: SDK translated to Delphi

Post by journeyonmyway » Mon Aug 25, 2014 7:53 am

Can this version work in Delphi XE6?

Kline777
Posts: 1
Joined: Fri Dec 19, 2014 6:03 pm

Re: SDK translated to Delphi

Post by Kline777 » Mon Dec 22, 2014 11:28 am

I've test this example in XE3 and it didnt work. Is anyone working with this in newer versions?

antekgla
Posts: 1
Joined: Sun Jun 25, 2017 11:01 pm

Re: SDK translated to Delphi

Post by antekgla » Sun Jun 25, 2017 11:51 pm

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!

jinshaopu
Posts: 1
Joined: Tue Jul 09, 2019 2:36 am

Re: SDK translated to Delphi

Post by jinshaopu » Tue Jul 09, 2019 2:38 am

:D why not put it on github?let's update the file :roll:

void
Site Admin
Posts: 5478
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void » Tue Jul 09, 2019 7:19 am

I've fixed the corrupted Everything_Delphi7_example.rar file, please try:

Everything_Delphi7_example.rar.

STest6905
Posts: 4
Joined: Tue Jan 14, 2020 6:17 am

Re: SDK translated to Delphi

Post by STest6905 » Tue Jan 14, 2020 10:15 am

what does the string mean?
Is this text to search? he’s not looking for anything from me ...
Everything_SetSearchA('restorator');

STest6905
Posts: 4
Joined: Tue Jan 14, 2020 6:17 am

Re: SDK translated to Delphi

Post by STest6905 » Tue Jan 14, 2020 2:27 pm

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

void
Site Admin
Posts: 5478
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void » Wed Jan 15, 2020 12:36 am

Please use the Unicode version of the Everything SDK functions (the functions ending with W instead of A):

STest6905
Posts: 4
Joined: Tue Jan 14, 2020 6:17 am

Re: SDK translated to Delphi

Post by STest6905 » Wed Jan 15, 2020 6:36 am

Thanks, it's really help!!!

Kajoj
Posts: 2
Joined: Sat Jan 11, 2020 12:26 pm

Re: SDK translated to Delphi

Post by Kajoj » Thu Jan 16, 2020 12:41 pm

Could anyone extend this example to use the Everything_GetResultSize function?
Thanks!

void
Site Admin
Posts: 5478
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void » Wed Jan 22, 2020 12:57 am

Please try:


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

...

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


Kajoj
Posts: 2
Joined: Sat Jan 11, 2020 12:26 pm

Re: SDK translated to Delphi

Post by Kajoj » Thu Jan 23, 2020 9:38 pm

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;  

Post Reply