SDK translated to Delphi
SDK translated to Delphi
SDK translated to Delphi, does anyone have?
Share it, please.
Share it, please.
Re: SDK translated to Delphi
A small example for Delphi7 in attachment
Pasted TestMain.pas contents here -void
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 1174 times
-
- Posts: 1
- Joined: Mon Aug 25, 2014 5:55 am
Re: SDK translated to Delphi
Can this version work in Delphi XE6?
Re: SDK translated to Delphi
I've test this example in XE3 and it didnt work. Is anyone working with this in newer versions?
Re: SDK translated to Delphi
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!
I try with 7zip and Winrar but same result... corrupt
Anyone has the file?
Thanks in advance!
Re: SDK translated to Delphi
why not put it on github?let's update the file
Re: SDK translated to Delphi
I've fixed the corrupted Everything_Delphi7_example.rar file, please try:
Everything_Delphi7_example.rar.
Everything_Delphi7_example.rar.
Re: SDK translated to Delphi
what does the string mean?
Is this text to search? he’s not looking for anything from me ...
Is this text to search? he’s not looking for anything from me ...
Everything_SetSearchA('restorator');
Re: SDK translated to Delphi
I figured out this problem. But there was another problem. Encoding. For some reason, I know how to do some cracking as a result ....
Re: SDK translated to Delphi
Please use the Unicode version of the Everything SDK functions (the functions ending with W instead of A):
Re: SDK translated to Delphi
Thanks, it's really help!!!
Re: SDK translated to Delphi
Could anyone extend this example to use the Everything_GetResultSize function?
Thanks!
Thanks!
Re: SDK translated to Delphi
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
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:
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;
-
- Posts: 76
- Joined: Sun Feb 21, 2016 10:26 pm
Re: SDK translated to Delphi
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.
I selected Yes.
When running the program, I got this result:
Re: SDK translated to Delphi
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)
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)