### SDK Initialization Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Example showing that the SDK initializes automatically and can be used immediately. ```delphi procedure TMainForm.FormCreate(Sender: TObject); begin // SDK initializes automatically // You can use SDK functions immediately ShowMessage('Everything Version: ' + Everything_GetVersion); end; ``` -------------------------------- ### SDK Cleanup Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Example demonstrating how to call Everything_CleanUp before application exit. ```delphi procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin Everything_CleanUp; // Free allocated memory CanClose := True; end; procedure TApplication.OnException(E: Exception); begin Everything_CleanUp; // Clean up even on exception inherited; end; ``` -------------------------------- ### Memory Management Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Example demonstrating how to copy a result string to preserve it after the next query. ```delphi var FileName: string; Ptr: PWideChar; begin Everything_SetSearch('test.txt'); Everything_Query(True); if Everything_GetNumResults > 0 then begin Ptr := Everything_GetResultFileNameW(0); FileName := string(Ptr); // Make a copy Everything_Reset; // This invalidates Ptr, but FileName is safe ShowMessage(FileName); // Still works because we copied it end; end; ``` -------------------------------- ### Thread-Safe Operations Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Demonstrates how to safely call SDK functions from multiple threads. ```delphi var Thread1, Thread2: TThread; procedure ExecuteQuery(const SearchTerm: string); begin Everything_SetSearch(SearchTerm); Everything_Query(True); ShowMessage(Format('Found: %d', [Everything_GetNumResults])); end; begin Thread1 := TThread.CreateAnonymousThread( procedure begin ExecuteQuery('*.txt'); end); Thread2 := TThread.CreateAnonymousThread( procedure begin ExecuteQuery('*.exe'); end); Thread1.Start; Thread2.Start; Thread1.WaitFor; Thread2.WaitFor; end; ``` -------------------------------- ### Runtime Check for Everything Service Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Example of how to check if the Everything service is running at runtime. ```delphi if Everything_GetLastError = EVERYTHING_ERROR_IPC then begin ShowMessage('Everything service is not running. Please install Everything.'); Exit; end; ``` -------------------------------- ### System Functions Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example showing how to display the Everything version and check if the database is loaded. ```delphi ShowMessage('Everything Version: ' + Everything_GetVersion); if not Everything_IsDBLoaded then ShowMessage('Database is still loading...') else ShowMessage('Database is ready'); ``` -------------------------------- ### Run History Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example demonstrating how to get and increment the run count for a file. ```delphi var RunCount := Everything_GetRunCountFromFileName('C:\test.exe'); ShowMessage(Format('Run count: %d', [RunCount])); // When user runs the file, increment: Everything_IncRunCountFromFileName('C:\test.exe'); ``` -------------------------------- ### Search Options Functions Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example demonstrating how to configure search behavior, including matching paths, case sensitivity, whole word matching, regex, and limiting results. ```delphi Everything_SetMatchPath(True); // Include path in search Everything_SetRegex(True); // Use regex patterns Everything_SetMax(100); // Limit to 100 results Everything_Query(True); ``` -------------------------------- ### Everything_SetRegex Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Enables regular expression matching and provides an example. ```delphi Everything_SetRegex(True); Everything_SetSearch('^test[0-9]+\.txt$'); // Match test followed by digits ``` -------------------------------- ### Sort Options Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example of setting the sort order for search results. ```delphi Everything_SetSort(EVERYTHING_SORT_DATE_MODIFIED_DESCENDING); ``` -------------------------------- ### Basic Usage Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md A simple Delphi code example demonstrating how to perform a basic search using the EverythingSDK, retrieve file names and paths, and display the number of results and the first result's name. ```delphi uses EverythingSDK; procedure SimpleSearch; begin // Set what we're searching for Everything_SetSearch('*.pdf'); // Configure what information to retrieve Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE ); // Execute the search if Everything_Query(True) then begin ShowMessage(Format('Found %d PDF files', [Everything_GetNumResults])); // Display first result if Everything_GetNumResults > 0 then begin ShowMessage(Format('First result: %s', [Everything_GetResultFileName(0)])); end; end else begin ShowMessage('Search failed: ' + Everything_GetErrorMessage(Everything_GetLastError)); end; // Clean up when done (in program shutdown) Everything_CleanUp; end; ``` -------------------------------- ### Delphi Usage Example Source: https://github.com/delphilite/everythingsdk/blob/master/README.md A simple example demonstrating how to use the EverythingSDK in a Delphi application to search for files and display their details. ```pascal uses SysUtils, Windows, EverythingSDK; { or EverythingImpl instead of EverythingSDK } function FileTimeToDateTime(const AFileTime: TFileTime): TDateTime; var LocalFileTime: TFileTime; SystemTime: TSystemTime; begin FileTimeToLocalFileTime(AFileTime, LocalFileTime); FileTimeToSystemTime(LocalFileTime, SystemTime); Result := SystemTimeToDateTime(SystemTime); end; function FormatFileAttrib(AAttrib: DWORD): string; begin if AAttrib and faDirectory <> 0 then Result := ' ' else begin Result := ''; if AAttrib and faReadOnly <> 0 then Result := Result + 'r' else Result := Result + '-'; if AAttrib and faArchive <> 0 then Result := Result + 'a' else Result := Result + '-'; if AAttrib and faHidden <> 0 then Result := Result + 'h' else Result := Result + '-'; if AAttrib and faSysFile <> 0 then Result := Result + 's' else Result := Result + '-'; end; end; procedure Execute(const AFind: string); var C, F, I, R: DWORD; dwAttributes: DWORD; fileName: string; fileAttrib, fileSize, fileTime: string; ftModified: TFileTime; nSize: Int64; begin Writeln('Find: ', AFind); Everything_SetSearch(PChar(AFind)); F := EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_DATE_MODIFIED or EVERYTHING_REQUEST_SIZE or EVERYTHING_REQUEST_ATTRIBUTES; Everything_SetRequestFlags(F); Everything_SetSort(EVERYTHING_SORT_PATH_ASCENDING); Writeln('Execute Query'); if not Everything_Query(True) then begin R := Everything_GetLastError; raise Exception.Create(Everything_GetErrorMessage(R)); end; Writeln('Result List Request Flags: ', Everything_GetResultListRequestFlags()); C := Everything_GetNumResults(); Writeln('Result List Count: ', C); if C > 0 then for I := 0 to C - 1 do begin SetLength(fileName, MAX_PATH); R := Everything_GetResultFullPathName(I, PChar(fileName), MAX_PATH); SetLength(fileName, R); dwAttributes := Everything_GetResultAttributes(I); fileAttrib := FormatFileAttrib(dwAttributes); fileAttrib := Format('%6s', [fileAttrib]); Everything_GetResultSize(I, nSize); if dwAttributes and faDirectory <> 0 then fileSize := '-1' else fileSize := FormatFloat('#,#.#',nSize); fileSize := Format('%16s', [fileSize]); if Everything_GetResultDateModified(I, ftModified) then fileTime := FormatDateTime('yyyy/mm/dd hh:nn:ss', FileTimeToDateTime(ftModified)) else fileTime := StringOfChar(' ', 19); Writeln(fileTime, ' ', fileAttrib, ' ', fileSize, ' ', fileName); end; end; begin ReportMemoryLeaksOnShutdown := True; try WriteLn('Everything: ', Everything_GetVersion); WriteLn(''); Execute('*.iso'); WriteLn(''); WriteLn('Done.'); except on E: Exception do WriteLn('Error: ', E.Message); end; ReadLn; Everything_CleanUp; end. ``` -------------------------------- ### Search and Query Functions Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example demonstrating how to set search string, sort order, and request flags for a search query. ```delphi Everything_SetSearch('test*.txt'); Everything_SetSort(EVERYTHING_SORT_NAME_ASCENDING); Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH); Everything_Query(True); ``` -------------------------------- ### Clone the repository Source: https://github.com/delphilite/everythingsdk/blob/master/README.md Instructions for manually installing the EverythingSDK by cloning the repository. ```shell git clone https://github.com/delphilite/EverythingSDK.git ``` -------------------------------- ### Example Usage of Everything_GetResultHighlightedFileNameW Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Example demonstrating how to retrieve and use the highlighted filename. ```delphi var Highlighted: string; begin Highlighted := string(Everything_GetResultHighlightedFileNameW(0)); // Example: If searching for "test" in "mytestfile.txt" // Result might be "my*test*file.txt" end; ``` -------------------------------- ### EverythingImpl.pas Import Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Import statement for the IPC-based EverythingImpl module. ```delphi uses EverythingImpl; ``` -------------------------------- ### Everything_SetMatchWholeWord Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Enables whole word matching and provides an example. ```delphi Everything_SetMatchWholeWord(True); Everything_SetSearch('test'); // Will match "test.txt" but not "test123.txt" ``` -------------------------------- ### Everything_GetResultHighlightedFullPathAndFileNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Example usage of Everything_GetResultHighlightedFullPathAndFileNameW to get the highlighted path and filename. ```delphi var Highlighted: string; begin Highlighted := string(Everything_GetResultHighlightedFullPathAndFileNameW(0)); // Example: "C:\Documents\my*test*file.txt" end; ``` -------------------------------- ### Launching Everything Service Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md How to launch the Everything service from code if it's not running. ```delphi ShellExecute(0, 'open', 'Everything.exe', '', '', SW_HIDE); ``` -------------------------------- ### EverythingSDK.pas Import Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Import statement for the standard EverythingSDK module. ```delphi uses EverythingSDK; ``` -------------------------------- ### EverythingIPC.pas Import Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Import statement for the low-level EverythingIPC module. ```delphi uses EverythingIPC; ``` -------------------------------- ### Adding to Uses Clause Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md How to add the Everything SDK to your Delphi project's uses clause. ```delphi uses SysUtils, EverythingSDK; // or EverythingImpl ``` -------------------------------- ### Example Usage of Everything_GetResultSize Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Demonstrates how to get the file size of a result. ```delphi var Size: Int64; begin if Everything_GetResultSize(0, Size) then ShowMessage(Format('File size: %d bytes', [Size])) else ShowMessage('Size information not available'); end; ``` -------------------------------- ### Result Accessor Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example demonstrating how to retrieve basic file information (name, path, size) for a found result. ```delphi if Everything_GetNumResults > 0 then begin var FileName := string(Everything_GetResultFileName(0)); var FilePath := string(Everything_GetResultPath(0)); var FileSize: Int64; Everything_GetResultSize(0, FileSize); ShowMessage(Format('%s\%s (%d bytes)', [FilePath, FileName, FileSize])); end; ``` -------------------------------- ### Everything_IsQueryReply Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Example usage of Everything_IsQueryReply within a window message handling routine. ```delphi procedure TMyForm.WndProc(var Message: TMessage); begin if Everything_IsQueryReply(Message.Msg, Message.WParam, Message.LParam, MY_REPLY_ID) then begin // Process results ShowMessage(Format('Got %d results', [Everything_GetNumResults])); end else inherited WndProc(Message); end; ``` -------------------------------- ### Request Flags Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Example of setting request flags to specify which result attributes to retrieve. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE or EVERYTHING_REQUEST_DATE_MODIFIED ); ``` -------------------------------- ### Example Usage of Everything_GetResultExtension Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Demonstrates how to get the file extension of a result. ```delphi var Ext: string; begin Ext := string(Everything_GetResultExtension(0)); ShowMessage('Extension: ' + Ext); end; ``` -------------------------------- ### Everything_MSIStartService Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Function signature for Everything_MSIStartService, used to start the Everything service after MSI installations. ```delphi function Everything_MSIStartService(msihandle: Pointer): UINT; stdcall; ``` -------------------------------- ### Safe Search Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md An example of a safe search procedure that includes error handling and prerequisite checks. ```delphi procedure SafeSearch(const SearchTerm: string); begin if not Everything_IsDBLoaded then begin ShowMessage('Database not loaded yet'); Exit; end; Everything_SetSearch(SearchTerm); if not Everything_Query(True) then begin ShowMessage('Error: ' + Everything_GetErrorMessage(Everything_GetLastError)); Exit; end; if Everything_GetNumResults > 0 then begin // Safe to access results end; Everything_CleanUp; end; ``` -------------------------------- ### Everything_SetMatchCase Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Disables case-sensitive matching and shows an example of a case-insensitive search. ```delphi Everything_SetMatchCase(False); // Case-insensitive search Everything_SetSearch('TEST'); // Will match test, Test, TEST, etc. ``` -------------------------------- ### Everything_GetMatchPath Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves and displays the current path matching setting. ```delphi if Everything_GetMatchPath then ShowMessage('Path matching is enabled') else ShowMessage('Path matching is disabled'); ``` -------------------------------- ### Search with Regex Patterns Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/README.md This example demonstrates how to enable and use regular expressions for searching. ```delphi Everything_SetRegex(True); Everything_SetSearch('^test[0-9]+\..*'); Everything_Query(True); ``` -------------------------------- ### Static Linking Configuration Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Compiler directive to enable static linking (default). ```delphi {$DEFINE ET_STATICLINK} // Keep this enabled (default) ``` -------------------------------- ### Everything_SetMatchPath Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Enables path matching in search queries and demonstrates its usage. ```delphi uses EverythingSDK; begin Everything_SetMatchPath(True); // Include paths in search Everything_SetSearch('Documents\*.txt'); Everything_Query(True); ShowMessage(Format('Found %d results', [Everything_GetNumResults])); end; ``` -------------------------------- ### All basic file information Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/constants.md Example of setting request flags for all basic file information. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE or EVERYTHING_REQUEST_ATTRIBUTES or EVERYTHING_REQUEST_DATE_MODIFIED ); ``` -------------------------------- ### Example Usage of Everything_Query Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Demonstrates how to set search parameters, execute a query, and handle results or errors. ```delphi uses EverythingSDK; begin Everything_SetSearch('*.pdf'); Everything_SetMax(100); Everything_SetOffset(0); if Everything_Query(True) then begin // Wait for query to complete before accessing results if Everything_GetNumResults > 0 then ShowMessage(Format('Found %d results', [Everything_GetNumResults])); end else begin ShowMessage('Error: ' + Everything_GetErrorMessage(Everything_GetLastError)); end; end; ``` -------------------------------- ### Example Usage of Everything_GetResultDateModified Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Demonstrates how to get the modification date of a file. ```delphi var FileTime: TFileTime; SystemTime: TSystemTime; DateTime: TDateTime; begin if Everything_GetResultDateModified(0, FileTime) then begin FileTimeToLocalFileTime(FileTime, FileTime); FileTimeToSystemTime(FileTime, SystemTime); DateTime := SystemTimeToDateTime(SystemTime); ShowMessage('Modified: ' + DateTimeToStr(DateTime)); end; end; ``` -------------------------------- ### Everything_GetSearchW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Sets a search string and then retrieves it using Everything_GetSearchW. ```delphi var SearchStr: PWideChar; begin Everything_SetSearchW(PWideChar('*.txt')); SearchStr := Everything_GetSearchW; ShowMessage('Current search: ' + string(SearchStr)); end; ``` -------------------------------- ### Dynamic DLL Linking Configuration Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Compiler directive to enable dynamic DLL loading instead of static linking. ```delphi {$UNDEF ET_STATICLINK} // Use dynamic DLL instead of static lib ``` -------------------------------- ### Everything_SetSort Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Sets the sort order for query results and demonstrates its usage. ```delphi Everything_SetSort(EVERYTHING_SORT_DATE_MODIFIED_DESCENDING); Everything_SetSearch('*.txt'); Everything_Query(True); // Results will be ordered by modification date, newest first ``` -------------------------------- ### Basic filename and path information Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/constants.md Example of setting request flags for basic filename and path information. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH ); ``` -------------------------------- ### With highlighted search terms Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/constants.md Example of setting request flags to include highlighted search terms. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME or EVERYTHING_REQUEST_HIGHLIGHTED_PATH or EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME ); ``` -------------------------------- ### Everything_GetResultFileNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Demonstrates how to retrieve and display the filename of the first result. ```delphi if Everything_GetNumResults > 0 then ShowMessage('First file: ' + string(Everything_GetResultFileNameW(0))); ``` -------------------------------- ### Handling EVERYTHING_ERROR_MEMORY Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example of how to handle an out-of-memory error. ```delphi if not Everything_Query(True) then begin if Everything_GetLastError = EVERYTHING_ERROR_MEMORY then begin ShowMessage('Out of memory. Close some applications and try again.'); Exit; end; end; ``` -------------------------------- ### Dynamic Linking Configuration Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Compiler directive to disable static linking, enabling dynamic linking. ```delphi {$UNDEF ET_STATICLINK} // Disable static linking ``` -------------------------------- ### Error Handling: Error Code Checking Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Checking specific error codes after a function fails. ```delphi if not Everything_Query(True) then begin case Everything_GetLastError of EVERYTHING_ERROR_IPC: ShowMessage('Everything service not running'); EVERYTHING_ERROR_MEMORY: ShowMessage('Out of memory'); else ShowMessage(Everything_GetErrorMessage(Everything_GetLastError)); end; end; ``` -------------------------------- ### Handling EVERYTHING_OK Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example of how to handle a successful query and check for errors. ```delphi if Everything_Query(True) then ShowMessage('Query successful') else begin ErrorCode := Everything_GetLastError; if ErrorCode <> EVERYTHING_OK then ShowMessage('Error: ' + Everything_GetErrorMessage(ErrorCode)); end; ``` -------------------------------- ### Example Usage of Everything_GetResultAttributes Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Demonstrates how to check file attributes like read-only and hidden. ```delphi var Attribs: DWORD; begin Attribs := Everything_GetResultAttributes(0); if (Attribs and faReadOnly) <> 0 then ShowMessage('File is read-only'); if (Attribs and faHidden) <> 0 then ShowMessage('File is hidden'); end; ``` -------------------------------- ### Everything_SetRequestFlags Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Sets which result attributes should be retrieved and demonstrates requesting specific attributes. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE or EVERYTHING_REQUEST_DATE_MODIFIED ); Everything_SetSearch('*.exe'); Everything_Query(True); // Now you can access these attributes for each result if Everything_GetNumResults > 0 then begin ShowMessage(Format('First result: %s', [Everything_GetResultFileName(0)])); end; ``` -------------------------------- ### Everything_GetResultPath Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Retrieves and displays the path of the first result if results are available. ```delphi var Path: string; begin if Everything_GetNumResults > 0 then begin Path := string(Everything_GetResultPath(0)); ShowMessage('Path: ' + Path); end; end; ``` -------------------------------- ### Everything_SetMax Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Sets the maximum number of results to return and demonstrates how to display the number of results found. ```delphi Everything_SetMax(100); // Limit to 100 results Everything_SetSearch('*.tmp'); Everything_Query(True); ShowMessage(Format('Results returned: %d (of %d total)', [Everything_GetNumResults, Everything_GetTotResults])); ``` -------------------------------- ### Handling EVERYTHING_ERROR_REGISTERCLASSEX Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example of how to handle a failure to register a window class. ```delphi if not Everything_Query(True) then begin if Everything_GetLastError = EVERYTHING_ERROR_REGISTERCLASSEX then begin ShowMessage('Failed to initialize window class. System resources may be low.'); Exit; end; end; ``` -------------------------------- ### Error Handling: Return Value Checking Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/configuration.md Checking the return value of a function immediately for error reporting. ```delphi if not Everything_Query(True) then ShowMessage('Query failed'); ``` -------------------------------- ### Handle Errors Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/README.md Example of how to check for query errors and retrieve the error message. ```delphi if not Everything_Query(True) then ShowMessage(Everything_GetErrorMessage(Everything_GetLastError)); ``` -------------------------------- ### Everything_SetOffset Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Sets the result offset for pagination and demonstrates its usage with other search functions. ```delphi const RESULTS_PER_PAGE = 50; procedure ShowResultsPage(PageNumber: Integer); var Offset: DWORD; begin Offset := (PageNumber - 1) * RESULTS_PER_PAGE; Everything_SetSearch('*.txt'); Everything_SetOffset(Offset); Everything_SetMax(RESULTS_PER_PAGE); Everything_Query(True); ShowMessage(Format('Page %d: %d results', [PageNumber, Everything_GetNumResults])); end; ``` -------------------------------- ### Everything_GetResultFileName Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Iterates through all results and displays their index and filename. ```delphi procedure DisplayResults; var i: Integer; begin for i := 0 to Everything_GetNumResults - 1 do ShowMessage(Format('[%d] %s', [i, Everything_GetResultFileName(i)])); end; ``` -------------------------------- ### Example Usage of Everything_GetErrorMessage Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Demonstrates how to use Everything_GetErrorMessage to display meaningful error messages after a failed operation. ```delphi uses EverythingSDK; procedure PerformSearch(SearchTerm: string); var ErrorCode: DWORD; ErrorMessage: string; begin Everything_SetSearch(SearchTerm); if not Everything_Query(True) then begin ErrorCode := Everything_GetLastError; ErrorMessage := Everything_GetErrorMessage(ErrorCode); case ErrorCode of EVERYTHING_ERROR_MEMORY: ShowMessage('Memory error: ' + ErrorMessage); EVERYTHING_ERROR_IPC: ShowMessage('Everything service not running: ' + ErrorMessage); EVERYTHING_ERROR_INVALIDINDEX: ShowMessage('Invalid result index: ' + ErrorMessage); else ShowMessage('Error ' + IntToStr(ErrorCode) + ': ' + ErrorMessage); end; end; end; ``` -------------------------------- ### Handling EVERYTHING_ERROR_INVALIDREQUEST Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example demonstrating the correct order of setting request flags before querying. ```delphi begin // Set request flags BEFORE setting search string or querying Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH); Everything_SetSearch('test.txt'); if not Everything_Query(True) then ShowMessage(Everything_GetErrorMessage(Everything_GetLastError)); end; ``` -------------------------------- ### Everything_GetRunCountFromFileNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the run count for a file by its filename (Unicode version) and displays it. ```delphi var RunCount: DWORD; begin RunCount := Everything_GetRunCountFromFileNameW(PWideChar('C:\Program Files\MyApp\MyApp.exe')); ShowMessage(Format('This application has been run %d times', [RunCount])); end; ``` -------------------------------- ### Everything_GetResultFullPathNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Retrieves and displays the full path and filename of the first result using a pre-allocated buffer. ```delphi var FullPath: array[0..MAX_PATH - 1] of WideChar; CharsWritten: DWORD; begin if Everything_GetNumResults > 0 then begin CharsWritten := Everything_GetResultFullPathNameW(0, @FullPath[0], MAX_PATH); ShowMessage('Full path: ' + string(FullPath)); end; end; ``` -------------------------------- ### Everything_GetRunCountFromFileName Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the run count for a file by its filename (Universal version) and displays it. ```delphi ShowMessage(Format('Run count: %d', [Everything_GetRunCountFromFileName(PChar('C:\test.exe'))])); ``` -------------------------------- ### Everything_SetSearchW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Sets the search string in wide character format (Unicode) and executes a query. ```delphi uses EverythingSDK; begin Everything_SetSearchW(PWideChar('*.pdf')); if not Everything_Query(True) then ShowMessage('Query failed: ' + Everything_GetErrorMessage(Everything_GetLastError)); end; ``` -------------------------------- ### Everything_SetSearch Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Sets the search string using the universal setter, sets sort order, request flags, and executes a query. ```delphi uses EverythingSDK; begin Everything_SetSearch('test.txt'); Everything_SetSort(EVERYTHING_SORT_NAME_ASCENDING); Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH); if Everything_Query(True) then begin ShowMessage(Format('Found %d results', [Everything_GetNumResults])); end; end; ``` -------------------------------- ### Everything_IsFileResult Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Iterates through the current result set and displays whether each result is a file or a folder. ```delphi var i: Integer; begin for i := 0 to Everything_GetNumResults - 1 do begin if Everything_IsFileResult(i) then ShowMessage('Result ' + IntToStr(i) + ' is a file') else if Everything_IsFolderResult(i) then ShowMessage('Result ' + IntToStr(i) + ' is a folder'); end; end; ``` -------------------------------- ### Everything_SetRunCountFromFileNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Resets the run count for a file to zero using the Unicode version. ```delphi // Reset run count to zero Everything_SetRunCountFromFileNameW(PWideChar('C:\test.exe'), 0); ``` -------------------------------- ### Everything_IncRunCountFromFileNameW Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Increments the run count for a file by one (Unicode version) and displays the new count. ```delphi var NewCount: DWORD; begin // Increment run count when launching the file NewCount := Everything_IncRunCountFromFileNameW( PWideChar('C:\Program Files\App\app.exe')); ShowMessage(Format('Run count is now: %d', [NewCount])); end; ``` -------------------------------- ### Everything_MSIExitAndStopService Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Function signature for Everything_MSIExitAndStopService, used to stop the Everything service during MSI installations. ```delphi function Everything_MSIExitAndStopService(msihandle: Pointer): UINT; stdcall; ``` -------------------------------- ### Handling EVERYTHING_ERROR_IPC Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example of how to handle an IPC error, indicating the Everything service is not running. ```delphi if not Everything_Query(True) then begin if Everything_GetLastError = EVERYTHING_ERROR_IPC then begin ShowMessage('Everything service is not running. ' + 'Please ensure Everything is installed and running.'); Exit; end; end; ``` -------------------------------- ### Everything_GetTotResults Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Retrieves the total number of matching results on the system and displays it along with the number of currently returned results. ```delphi Everything_SetSearch('*.avi'); Everything_SetMax(50); Everything_Query(True); ShowMessage(Format('Found %d video files total (showing %d)', [Everything_GetTotResults, Everything_GetNumResults])); ``` -------------------------------- ### Handling EVERYTHING_ERROR_INVALIDINDEX Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Example of a safe procedure to get a result file name, checking for valid indices. ```delphi procedure SafeGetResult(Index: Integer); begin if Index >= 0 then begin if Index < Integer(Everything_GetNumResults) then ShowMessage(string(Everything_GetResultFileName(Index))) else ShowMessage('Result index out of range'); end; end; ``` -------------------------------- ### Everything_GetNumResults Example Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-result-functions.md Retrieves the number of results in the current result set and displays it along with the total number of results. ```delphi Everything_SetSearch('*.txt'); Everything_SetMax(100); Everything_Query(True); ShowMessage(Format('Returned: %d of %d total results', [Everything_GetNumResults, Everything_GetTotResults])); ``` -------------------------------- ### Search with Detailed Information Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/README.md This snippet shows how to request specific details like file name, path, and size for text files. ```delphi Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE ); Everything_SetSearch('*.txt'); Everything_Query(True); ``` -------------------------------- ### Everything_GetVersion Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the current version of the Everything SDK as a formatted string. ```delphi function Everything_GetVersion: string; ``` ```delphi uses EverythingSDK; begin ShowMessage('Everything Version: ' + Everything_GetVersion); end; ``` -------------------------------- ### Implement Pagination Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/README.md This code snippet illustrates how to implement pagination by setting offset and maximum results. ```delphi Everything_SetOffset((PageNumber - 1) * 50); Everything_SetMax(50); Everything_Query(True); ``` -------------------------------- ### Everything_GetReplyWindow Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves the current reply window handle. ```delphi function Everything_GetReplyWindow: HWND; stdcall; ``` -------------------------------- ### Search with Details Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Performs a search and retrieves detailed information for each result, including file name, path, and size. ```delphi procedure SearchWithDetails(const Pattern: string); var i: Integer; FileName, FilePath: string; FileSize: Int64; begin Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE ); Everything_SetSearch(Pattern); if Everything_Query(True) then begin for i := 0 to Everything_GetNumResults - 1 do begin FileName := string(Everything_GetResultFileName(i)); FilePath := string(Everything_GetResultPath(i)); Everything_GetResultSize(i, FileSize); Writeln(Format('%s\%s (%d)', [FilePath, FileName, FileSize])); end; end; Everything_CleanUp; end; ``` -------------------------------- ### Correct Error Handling vs. Exception Handling Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Illustrates the correct way to handle errors in the Everything SDK by checking return values, as opposed to using try-except blocks which are ineffective for SDK errors. ```delphi // Wrong: No exception will be raised try Everything_Query(True); // If this fails, nothing is raised except on E: Exception do ShowMessage(E.Message); // This will not catch SDK errors end; // Correct: Check return value if not Everything_Query(True) then ShowMessage('Query failed: ' + Everything_GetErrorMessage(Everything_GetLastError)); ``` -------------------------------- ### Everything_GetMajorVersion Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the major version number. ```delphi function Everything_GetMajorVersion: DWORD; stdcall; ``` -------------------------------- ### Everything_GetMinorVersion Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the minor version number. ```delphi function Everything_GetMinorVersion: DWORD; stdcall; ``` -------------------------------- ### Pagination Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Implements search pagination by setting an offset and a maximum number of results per page. ```delphi procedure SearchPage(const Pattern: string; PageNumber: Integer); const PAGE_SIZE = 50; var i: Integer; Offset: DWORD; begin Offset := (PageNumber - 1) * PAGE_SIZE; Everything_SetSearch(Pattern); Everything_SetOffset(Offset); Everything_SetMax(PAGE_SIZE); Everything_Query(True); Writeln(Format('Page %d: %d/%d results', [PageNumber, Everything_GetNumResults, Everything_GetTotResults])); Everything_CleanUp; end; ``` -------------------------------- ### Search for Files Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/README.md This code snippet demonstrates a simple search for PDF files and displays the count of results. ```delphi Everything_SetSearch('*.pdf'); Everything_Query(True); ShowMessage(Format('Found %d PDF files', [Everything_GetNumResults])); ``` -------------------------------- ### Advanced Searching Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md Demonstrates advanced search capabilities including regex, sorting, and specific file type filtering. ```delphi procedure AdvancedSearch; begin Everything_SetSearch('*.pdf'); Everything_SetMatchPath(True); // Search paths too Everything_SetRegex(True); // Use regex Everything_SetSort(EVERYTHING_SORT_SIZE_DESCENDING); // Largest first Everything_SetMax(100); // Limit to 100 Everything_SetRequestFlags( EVERYTHING_REQUEST_FILE_NAME or EVERYTHING_REQUEST_PATH or EVERYTHING_REQUEST_SIZE or EVERYTHING_REQUEST_DATE_MODIFIED ); if Everything_Query(True) then ShowMessage(Format('Found %d largest PDFs', [Everything_GetNumResults])) else ShowMessage('Search failed'); Everything_CleanUp; end; ``` -------------------------------- ### Check for Required Prerequisites Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Confirms that the Everything database is loaded before executing queries. ```delphi begin if not Everything_IsDBLoaded then begin ShowMessage('Everything database is not loaded. Please wait...'); Exit; end; Everything_SetSearch('test'); Everything_Query(True); end; ``` -------------------------------- ### Everything_GetBuildNumber Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the build number. ```delphi function Everything_GetBuildNumber: DWORD; stdcall; ``` -------------------------------- ### Everything_Query Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Universal query executor. ```delphi function Everything_Query(bWait: BOOL): BOOL; stdcall; ``` -------------------------------- ### Everything_CleanUp Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Cleans up and releases all resources allocated by the SDK. ```delphi procedure Everything_CleanUp; stdcall; ``` ```delphi procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin Everything_CleanUp; CanClose := True; end; ``` -------------------------------- ### Simple Search Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/overview.md A basic procedure to perform a search using a given pattern, query the results, and display the count. ```delphi procedure SearchFiles(const Pattern: string); begin Everything_SetSearch(Pattern); Everything_Query(True); ShowMessage(Format('Found %d results', [Everything_GetNumResults])); Everything_CleanUp; end; ``` -------------------------------- ### Everything_SetReplyWindow Procedure Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Sets the window handle to receive asynchronous query results. ```delphi procedure Everything_SetReplyWindow(hWnd: HWND); stdcall; ``` -------------------------------- ### Everything_GetTargetMachine Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the target machine architecture. ```delphi function Everything_GetTargetMachine: DWORD; stdcall; ``` ```delphi var Target: DWORD; begin Target := Everything_GetTargetMachine; case Target of EVERYTHING_TARGET_MACHINE_X86: ShowMessage('Everything is 32-bit'); EVERYTHING_TARGET_MACHINE_X64: ShowMessage('Everything is 64-bit'); EVERYTHING_TARGET_MACHINE_ARM: ShowMessage('Everything is ARM'); end; end; ``` -------------------------------- ### Everything_GetRequestFlags Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves the current request flags setting. ```delphi function Everything_GetRequestFlags: DWORD; stdcall; ``` -------------------------------- ### Everything_RebuildDB Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Forces a complete rebuild of the Everything database. ```delphi function Everything_RebuildDB: BOOL; stdcall; ``` -------------------------------- ### Everything_QueryA Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Executes a search query using the current search string and parameters (ANSI version). ```delphi function Everything_QueryA(bWait: BOOL): BOOL; stdcall; ``` -------------------------------- ### EVERYTHING_IPC_COMMAND_LINE Structure Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/types.md Structure for sending command line commands to Everything via IPC. ```delphi type EVERYTHING_IPC_COMMAND_LINE = packed record // ShowWindow() command (SW_HIDE, SW_SHOW, etc.) show_command: DWORD; // Null-terminated UTF-8 encoded command line text. command_line_text: array[0..0] of BYTE; end; ``` -------------------------------- ### Everything_GetSort Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves the current sort setting. ```delphi function Everything_GetSort: DWORD; stdcall; ``` -------------------------------- ### Everything_IsAdmin Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Checks if the Everything service is running with administrator privileges. ```delphi function Everything_IsAdmin: BOOL; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedFullPathAndFileNameW Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Function signature for retrieving the highlighted full path and filename (Unicode version). ```delphi function Everything_GetResultHighlightedFullPathAndFileNameW(dwIndex: DWORD): PWideChar; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedPathW Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted path for a result (Unicode version). ```delphi function Everything_GetResultHighlightedPathW(dwIndex: DWORD): PWideChar; stdcall; ``` -------------------------------- ### Everything_IsDBLoaded Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Checks if the Everything database is loaded. ```delphi function Everything_IsDBLoaded: BOOL; stdcall; ``` ```delphi begin if Everything_IsDBLoaded then ShowMessage('Database is ready') else ShowMessage('Database is still loading...'); end; ``` -------------------------------- ### Everything_GetOffset Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves the current result offset. ```delphi function Everything_GetOffset: DWORD; stdcall; ``` -------------------------------- ### Everything_GetMax Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-options.md Retrieves the current maximum results limit. ```delphi function Everything_GetMax: DWORD; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedFullPathAndFileName Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Function signature for retrieving the highlighted full path and filename (Universal version). ```delphi function Everything_GetResultHighlightedFullPathAndFileName(dwIndex: DWORD): PChar; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedFullPathAndFileNameA Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Function signature for retrieving the highlighted full path and filename (ANSI version). ```delphi function Everything_GetResultHighlightedFullPathAndFileNameA(dwIndex: DWORD): PAnsiChar; stdcall; ``` -------------------------------- ### Everything_SaveDB Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Saves the Everything database to disk. ```delphi function Everything_SaveDB: BOOL; stdcall; ``` -------------------------------- ### Everything_SaveRunHistory Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Saves the run history to disk. ```delphi function Everything_SaveRunHistory: BOOL; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedPath Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted path for a result (Universal version). ```delphi function Everything_GetResultHighlightedPath(dwIndex: DWORD): PChar; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedFileName Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted filename for a result (Universal version). ```delphi function Everything_GetResultHighlightedFileName(dwIndex: DWORD): PChar; stdcall; ``` -------------------------------- ### Everything_QueryW Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-search-and-query.md Executes a search query using the current search string and parameters (Unicode version). ```delphi function Everything_QueryW(bWait: BOOL): BOOL; stdcall; ``` -------------------------------- ### Everything_IsQueryReply Function Signature Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Function signature for checking if a window message is a query reply notification. ```delphi function Everything_IsQueryReply(message: UINT; wParam: WPARAM; lParam: LPARAM; dwId: DWORD): BOOL; stdcall; ``` -------------------------------- ### ET_STATICLINK Directive Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/constants.md Enables static library linking. ```delphi {$DEFINE ET_STATICLINK} ``` -------------------------------- ### EVERYTHING_IPC_LIST2 Structure Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/types.md Extended result list structure. Requires Everything 1.4.1+. ```delphi type EVERYTHING_IPC_LIST2 = packed record // Total number of items found. totitems: DWORD; // Number of items available in this result. numitems: DWORD; // Index offset of the first result. offset: DWORD; // Valid request types for the returned data. request_flags: DWORD; // Actual sort type applied to results. sort_type: DWORD; // Items and data follow. end; PEVERYTHING_IPC_LIST2 = ^EVERYTHING_IPC_LIST2; ``` -------------------------------- ### Everything_GetResultHighlightedFileNameW Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted filename for a result (Unicode version). ```delphi function Everything_GetResultHighlightedFileNameW(dwIndex: DWORD): PWideChar; stdcall; ``` -------------------------------- ### Everything_GetRevision Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the revision number. ```delphi function Everything_GetRevision: DWORD; stdcall; ``` -------------------------------- ### Everything_IsAppData Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Checks if the Everything database is stored in AppData. ```delphi function Everything_IsAppData: BOOL; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedPathA Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted path for a result (ANSI version). ```delphi function Everything_GetResultHighlightedPathA(dwIndex: DWORD): PAnsiChar; stdcall; ``` -------------------------------- ### Everything_UpdateAllFolderIndexes Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Forces an update of all folder indexes. ```delphi function Everything_UpdateAllFolderIndexes: BOOL; stdcall; ``` -------------------------------- ### Everything_GetResultFileListFileName Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the file list filename reference for a result (Universal version). ```delphi function Everything_GetResultFileListFileName(dwIndex: DWORD): PChar; stdcall; ``` -------------------------------- ### Everything_GetResultHighlightedFileNameA Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the highlighted filename for a result (ANSI version). ```delphi function Everything_GetResultHighlightedFileNameA(dwIndex: DWORD): PAnsiChar; stdcall; ``` -------------------------------- ### Everything_Reset Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Resets all search parameters and clears the result cache. ```delphi procedure Everything_Reset; stdcall; ``` ```delphi procedure ClearSearch; begin Everything_Reset; // Now all search parameters are reset end; ``` -------------------------------- ### EVERYTHING_IPC_QUERYA Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/types.md ANSI version of the IPC query structure. ```delphi type EVERYTHING_IPC_QUERYA = packed record reply_hwnd: DWORD; reply_copydata_message: DWORD; search_flags: DWORD; offset: DWORD; max_results: DWORD; search_string: array[0..0] of CHAR; end; PEVERYTHING_IPC_QUERYA = ^EVERYTHING_IPC_QUERYA; ``` -------------------------------- ### Everything_GetResultFileListFileNameW Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the file list filename reference for a result (Unicode version). ```delphi function Everything_GetResultFileListFileNameW(dwIndex: DWORD): PWideChar; stdcall; ``` -------------------------------- ### EVERYTHING_IPC_QUERY2 Structure Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/types.md Extended query structure for more detailed result control. Requires Everything 1.4.1+. ```delphi type EVERYTHING_IPC_QUERY2 = packed record // Window to receive query completion notification. reply_hwnd: DWORD; // Message ID for notification. reply_copydata_message: DWORD; // Search flags (EVERYTHING_IPC_MATCHCASE, etc.) search_flags: DWORD; // Number of results to skip. offset: DWORD; // Maximum results to return. max_results: DWORD; // Request flags specifying which attributes to retrieve. request_flags: DWORD; // Sort type for results. sort_type: DWORD; // Followed by null-terminated search string. end; PEVERYTHING_IPC_QUERY2 = ^EVERYTHING_IPC_QUERY2; ``` -------------------------------- ### Everything_GetResultFileListFileNameA Function Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-run-history.md Retrieves the file list filename reference for a result (ANSI version). ```delphi function Everything_GetResultFileListFileNameA(dwIndex: DWORD): PAnsiChar; stdcall; ``` -------------------------------- ### Everything_Exit Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Shuts down the Everything service. ```delphi function Everything_Exit: BOOL; stdcall; ``` -------------------------------- ### SDK Version Constant Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/constants.md Constant indicating the SDK version. Version 2 includes 1.4.1 features. ```delphi const EVERYTHING_SDK_VERSION = 2; // If not defined, version is 1 ``` -------------------------------- ### Everything_GetLastError Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/api-reference-system-functions.md Retrieves the last error code. ```delphi function Everything_GetLastError: DWORD; stdcall; ``` ```delphi if not Everything_Query(True) then begin ErrorCode := Everything_GetLastError; ErrorMsg := Everything_GetErrorMessage(ErrorCode); ShowMessage('Query failed: ' + ErrorMsg); end; ``` -------------------------------- ### Graceful Degradation for Missing Features Source: https://github.com/delphilite/everythingsdk/blob/master/_autodocs/errors.md Handles cases where advanced information, like file size, might not be available. ```delphi procedure GetAdvancedInfo(Index: DWORD); var FileSize: Int64; begin if Everything_GetResultSize(Index, FileSize) then ShowMessage(Format('File size: %d bytes', [FileSize])) else ShowMessage('File size information not available'); end; ```