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 »

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 »

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
Attachments
Everything_Delphi7_example.rar
(25.23 KiB) Downloaded 951 times
journeyonmyway
Posts: 1
Joined: Mon Aug 25, 2014 5:55 am

Re: SDK translated to Delphi

Post by journeyonmyway »

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 »

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 »

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: 2
Joined: Tue Jul 09, 2019 2:36 am

Re: SDK translated to Delphi

Post by jinshaopu »

:D why not put it on github?let's update the file :roll:
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void »

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 »

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 »

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
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void »

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 »

Thanks, it's really help!!!
Kajoj
Posts: 2
Joined: Sat Jan 11, 2020 12:26 pm

Re: SDK translated to Delphi

Post by Kajoj »

Could anyone extend this example to use the Everything_GetResultSize function?
Thanks!
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post by void »

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 »

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;  
PeterPanino
Posts: 76
Joined: Sun Feb 21, 2016 10:26 pm

Re: SDK translated to Delphi

Post 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
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: SDK translated to Delphi

Post 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)
Post Reply