fanybupt

日出而作,日入而息,凿井而饮,耕田而食,帝力于我何有哉?

导航

Delphi版Everything函数

Posted on 2012-05-04 16:30  fanybupt  阅读(856)  评论(0)    收藏  举报

unit Everything;

interface
uses
  Windows;
 
const
  EVERYTHING_OK = 0;
  EVERYTHING_ERROR_MEMORY = 1;
  EVERYTHING_ERROR_IPC = 2;
  EVERYTHING_ERROR_REGISTERCLASSEX = 3;
  EVERYTHING_ERROR_CREATEWINDOW = 4;
  EVERYTHING_ERROR_CREATETHREAD = 5;
  EVERYTHING_ERROR_INVALIDINDEX = 6;
  EVERYTHING_ERROR_INVALIDCALL = 7;

  EverythingDLL = 'Everything.dll';

// write search state
procedure Everything_SetSearchW(lpString: LPCWSTR); stdcall;
procedure Everything_SetSearchA(lpString: LPCSTR); stdcall;
procedure Everything_SetMatchPath(bEnable: BOOL); stdcall;
procedure Everything_SetMatchCase(bEnable: BOOL); stdcall;
procedure Everything_SetMatchWholeWord(bEnable: BOOL); stdcall;
procedure Everything_SetRegex(bEnable: BOOL); stdcall;
procedure Everything_SetMax(dwMax: DWORD); stdcall;
procedure Everything_SetOffset(dwOffset: DWORD); stdcall;
procedure Everything_SetReplyWindow(AHwnd: HWND); stdcall;
procedure Everything_SetReplyID(nId: DWORD); stdcall;

// read search state
function Everything_GetMatchPath: Integer; stdcall;
function Everything_GetMatchCase: Integer; stdcall;
function Everything_GetMatchWholeWord: Integer; stdcall;
function Everything_GetRege: Integer; stdcall;
function Everything_GetMax: DWORD; stdcall;
function Everything_GetOffset: DWORD; stdcall;
function Everything_GetSearchA: LPCSTR; stdcall;
function Everything_GetSearchW: LPCWSTR; stdcall;
function Everything_GetLastError: DWORD; stdcall;
function Everything_GetReplyWindow: HWND; stdcall;
function Everything_GetReplyID: DWORD; stdcall;

// execute query
function Everything_QueryA(bWait: BOOL): Integer; stdcall;
function Everything_QueryW(bWait: BOOL): Integer; stdcall;

// query reply
function Everything_IsQueryReply(AMessage:UINT;
  wParam: WPARAM; lParam:LPARAM; nId: DWORD): BOOL; stdcall;

// write result state
procedure Everything_SortResultsByPath; stdcall;

// read result state
function Everything_GetNumFileResults: Integer; stdcall;
function Everything_GetNumFolderResults: Integer; stdcall;
function Everything_GetNumResults: Integer; stdcall;
function Everything_GetTotFileResults: Integer; stdcall;
function Everything_GetTotFolderResults: Integer; stdcall;
function Everything_GetTotResults: Integer; stdcall;
function Everything_IsVolumeResult(nIndex: Integer): Integer; stdcall;
function Everything_IsFolderResult(nIndex: Integer): Integer; stdcall;
function Everything_IsFileResult(nIndex: Integer): Integer; stdcall;
function Everything_GetResultFileNameW(nIndex: Integer): LPCWSTR; stdcall;
function Everything_GetResultFileNameA(nIndex: Integer): LPCSTR; stdcall;
function Everything_GetResultPathW(nIndex: Integer): LPCWSTR; stdcall;
function Everything_GetResultPathA(nIndex: Integer): LPCSTR; stdcall;

implementation

procedure Everything_SetSearchW; external EverythingDLL name 'Everything_SetSearchW';
procedure Everything_SetSearchA; external EverythingDLL name 'Everything_SetSearchA';
procedure Everything_SetMatchPath; external EverythingDLL name 'Everything_SetMatchPath';
procedure Everything_SetMatchCase; external EverythingDLL name 'Everything_SetMatchCase';
procedure Everything_SetMatchWholeWord; external EverythingDLL name 'Everything_SetMatchWholeWord';
procedure Everything_SetRegex; external EverythingDLL name 'Everything_SetRegex';
procedure Everything_SetMax; external EverythingDLL name 'Everything_SetMax';
procedure Everything_SetOffset; external EverythingDLL name 'Everything_SetOffset';
procedure Everything_SetReplyWindow; external EverythingDLL name 'Everything_SetReplyWindow';
procedure Everything_SetReplyID; external EverythingDLL name 'Everything_SetReplyID';

function Everything_GetMatchPath; external EverythingDLL name 'Everything_GetMatchPath';
function Everything_GetMatchCase; external EverythingDLL name 'Everything_GetMatchCase';
function Everything_GetMatchWholeWord; external EverythingDLL name 'Everything_GetMatchWholeWord';
function Everything_GetRege; external EverythingDLL name 'Everything_GetRege';
function Everything_GetMax: DWORD; external EverythingDLL name 'Everything_GetMax';
function Everything_GetOffset; external EverythingDLL name 'Everything_GetOffset';
function Everything_GetSearchA; external EverythingDLL name 'Everything_GetSearchA';
function Everything_GetSearchW; external EverythingDLL name 'Everything_GetSearchW';
function Everything_GetLastError; external EverythingDLL name 'Everything_GetLastError';
function Everything_GetReplyWindow; external EverythingDLL name 'Everything_GetReplyWindow';
function Everything_GetReplyID; external EverythingDLL name 'Everything_GetReplyID';

function Everything_QueryA; external EverythingDLL name 'Everything_QueryA';
function Everything_QueryW; external EverythingDLL name 'Everything_QueryW';

function Everything_IsQueryReply; external EverythingDLL name 'Everything_IsQueryReply';

procedure Everything_SortResultsByPath; external EverythingDLL name 'Everything_SortResultsByPath';

function Everything_GetNumFileResults; external EverythingDLL name 'Everything_GetNumFileResults';
function Everything_GetNumFolderResults; external EverythingDLL name 'Everything_GetNumFolderResults';
function Everything_GetNumResults; external EverythingDLL name 'Everything_GetNumResults';
function Everything_GetTotFileResults; external EverythingDLL name 'Everything_GetTotFileResults';
function Everything_GetTotFolderResults; external EverythingDLL name 'Everything_GetTotFolderResults';
function Everything_GetTotResults; external EverythingDLL name 'Everything_GetTotResults';
function Everything_IsVolumeResult; external EverythingDLL name 'Everything_IsVolumeResult';
function Everything_IsFolderResult; external EverythingDLL name 'Everything_IsFolderResult';
function Everything_IsFileResult; external EverythingDLL name 'Everything_IsFileResult';
function Everything_GetResultFileNameW; external EverythingDLL name 'Everything_GetResultFileNameW';
function Everything_GetResultFileNameA; external EverythingDLL name 'Everything_GetResultFileNameA';
function Everything_GetResultPathW; external EverythingDLL name 'Everything_GetResultPathW';
function Everything_GetResultPathA; external EverythingDLL name 'Everything_GetResultPathA';

end.