├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE ├── MANIFEST.in ├── PyEverything ├── _PyEverything.pyi ├── _PyEverything │ ├── PyEverything.cpp │ └── vendor │ │ └── Everything-SDK │ │ ├── include │ │ └── Everything.h │ │ ├── ipc │ │ └── everything_ipc.h │ │ └── src │ │ └── Everything.c ├── __init__.py └── __version__.py ├── README.md ├── create_builds.bat └── setup.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################ vs 2 | 3 | # User-specific files 4 | *.rsuser 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # Visual Studio 2015/2017 cache/options directory 11 | .vs/ 12 | 13 | ################ python 14 | 15 | # Byte-compiled / optimized / DLL files 16 | __pycache__/ 17 | *.py[cod] 18 | *$py.class 19 | 20 | # C extensions 21 | *.so 22 | 23 | # Distribution / packaging 24 | .Python 25 | build/ 26 | develop-eggs/ 27 | dist/ 28 | downloads/ 29 | eggs/ 30 | .eggs/ 31 | lib/ 32 | lib64/ 33 | parts/ 34 | sdist/ 35 | var/ 36 | wheels/ 37 | pip-wheel-metadata/ 38 | share/python-wheels/ 39 | *.egg-info/ 40 | .installed.cfg 41 | *.egg 42 | MANIFEST 43 | 44 | # PyInstaller 45 | # Usually these files are written by a python script from a template 46 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 47 | *.manifest 48 | *.spec 49 | 50 | # Installer logs 51 | pip-log.txt 52 | pip-delete-this-directory.txt 53 | 54 | # Unit test / coverage reports 55 | htmlcov/ 56 | .tox/ 57 | .nox/ 58 | .coverage 59 | .coverage.* 60 | .cache 61 | nosetests.xml 62 | coverage.xml 63 | *.cover 64 | .hypothesis/ 65 | .pytest_cache/ 66 | 67 | # Translations 68 | *.mo 69 | *.pot 70 | 71 | # Django stuff: 72 | *.log 73 | local_settings.py 74 | db.sqlite3 75 | 76 | # Flask stuff: 77 | instance/ 78 | .webassets-cache 79 | 80 | # Scrapy stuff: 81 | .scrapy 82 | 83 | # Sphinx documentation 84 | docs/_build/ 85 | 86 | # PyBuilder 87 | target/ 88 | 89 | # Jupyter Notebook 90 | .ipynb_checkpoints 91 | 92 | # IPython 93 | profile_default/ 94 | ipython_config.py 95 | 96 | # pyenv 97 | .python-version 98 | 99 | # pipenv 100 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 101 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 102 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 103 | # install all needed dependencies. 104 | #Pipfile.lock 105 | 106 | # celery beat schedule file 107 | celerybeat-schedule 108 | 109 | # SageMath parsed files 110 | *.sage.py 111 | 112 | # Environments 113 | .env 114 | .venv 115 | env/ 116 | venv/ 117 | ENV/ 118 | env.bak/ 119 | venv.bak/ 120 | 121 | # Spyder project settings 122 | .spyderproject 123 | .spyproject 124 | 125 | # Rope project settings 126 | .ropeproject 127 | 128 | # mkdocs documentation 129 | /site 130 | 131 | # mypy 132 | .mypy_cache/ 133 | .dmypy.json 134 | dmypy.json 135 | 136 | # Pyre type checker 137 | .pyre/ 138 | 139 | ################ project 140 | 141 | #Everything,pybind11, and build files 142 | _Everything_Python/[Bb]uild/ 143 | _Everything_Python/[Tt]emp/ 144 | _Everything_Python/[Dd]ebug/ 145 | 146 | ############### c++ 147 | 148 | #build objects 149 | *.obj 150 | *.pdb 151 | *.dll 152 | 153 | #vs upgrade logs 154 | UpgradeLog.htm 155 | 156 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pybind11"] 2 | path = pybind11 3 | url = https://github.com/pybind/pybind11 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | PyEverything 2 | 3 | MIT License 4 | 5 | Copyright (c) 2021 Michael Nam 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | 25 | Everything 26 | 27 | Copyright (C) 2020 David Carpenter 28 | 29 | Permission is hereby granted, free of charge, to any person obtaining a 30 | copy of this software and associated documentation files (the "Software"), 31 | to deal in the Software without restriction, including without limitation 32 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 33 | and/or sell copies of the Software, and to permit persons to whom the 34 | Software is furnished to do so, subject to the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be included in 37 | all copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 41 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 42 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 43 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 44 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 45 | DEALINGS IN THE SOFTWARE. 46 | 47 | Perl-Compatible Regular Expressions 48 | 49 | Copyright (c) 1997-2012 University of Cambridge 50 | 51 | Redistribution and use in source and binary forms, with or without 52 | modification, are permitted provided that the following conditions are met: 53 | 54 | * Redistributions of source code must retain the above copyright notice, 55 | this list of conditions and the following disclaimer. 56 | 57 | * Redistributions in binary form must reproduce the above copyright 58 | notice, this list of conditions and the following disclaimer in the 59 | documentation and/or other materials provided with the distribution. 60 | 61 | * Neither the name of the University of Cambridge nor the names of its 62 | contributors may be used to endorse or promote products derived from 63 | this software without specific prior written permission. 64 | 65 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 66 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 67 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 68 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 69 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 70 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 71 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 72 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 73 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 74 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 75 | POSSIBILITY OF SUCH DAMAGE. 76 | 77 | pybind11 78 | 79 | Copyright (c) 2016 Wenzel Jakob , All rights reserved. 80 | 81 | Redistribution and use in source and binary forms, with or without 82 | modification, are permitted provided that the following conditions are met: 83 | 84 | 1. Redistributions of source code must retain the above copyright notice, this 85 | list of conditions and the following disclaimer. 86 | 87 | 2. Redistributions in binary form must reproduce the above copyright notice, 88 | this list of conditions and the following disclaimer in the documentation 89 | and/or other materials provided with the distribution. 90 | 91 | 3. Neither the name of the copyright holder nor the names of its contributors 92 | may be used to endorse or promote products derived from this software 93 | without specific prior written permission. 94 | 95 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 96 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 97 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 98 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 99 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 100 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 101 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 102 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 103 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 104 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 105 | 106 | Please also refer to the file CONTRIBUTING.md, which clarifies licensing of 107 | external contributions to this project including patches, pull requests, etc. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md LICENSE -------------------------------------------------------------------------------- /PyEverything/_PyEverything.pyi: -------------------------------------------------------------------------------- 1 | from typing import overload 2 | import datetime 3 | EVERYTHING_ERROR_CREATETHREAD: int 4 | EVERYTHING_ERROR_CREATEWINDOW: int 5 | EVERYTHING_ERROR_INVALIDCALL: int 6 | EVERYTHING_ERROR_INVALIDINDEX: int 7 | EVERYTHING_ERROR_INVALIDPARAMETER: int 8 | EVERYTHING_ERROR_INVALIDREQUEST: int 9 | EVERYTHING_ERROR_IPC: int 10 | EVERYTHING_ERROR_MEMORY: int 11 | EVERYTHING_ERROR_REGISTERCLASSEX: int 12 | EVERYTHING_OK: int 13 | REQUEST_ATTRIBUTES: int 14 | REQUEST_DATE_ACCESSED: int 15 | REQUEST_DATE_CREATED: int 16 | REQUEST_DATE_MODIFIED: int 17 | REQUEST_DATE_RECENTLY_CHANGED: int 18 | REQUEST_DATE_RUN: int 19 | REQUEST_EXTENSION: int 20 | REQUEST_FILE_LIST_FILE_NAME: int 21 | REQUEST_FILE_NAME: int 22 | REQUEST_FULL_PATH_AND_FILE_NAME: int 23 | REQUEST_HIGHLIGHTED_FILE_NAME: int 24 | REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME: int 25 | REQUEST_HIGHLIGHTED_PATH: int 26 | REQUEST_PATH: int 27 | REQUEST_RUN_COUNT: int 28 | REQUEST_SIZE: int 29 | SORT_ATTRIBUTES_ASCENDING: int 30 | SORT_ATTRIBUTES_DESCENDING: int 31 | SORT_DATE_ACCESSED_ASCENDING: int 32 | SORT_DATE_ACCESSED_DESCENDING: int 33 | SORT_DATE_CREATED_ASCENDING: int 34 | SORT_DATE_CREATED_DESCENDING: int 35 | SORT_DATE_MODIFIED_ASCENDING: int 36 | SORT_DATE_MODIFIED_DESCENDING: int 37 | SORT_DATE_RECENTLY_CHANGED_ASCENDING: int 38 | SORT_DATE_RECENTLY_CHANGED_DESCENDING: int 39 | SORT_DATE_RUN_ASCENDING: int 40 | SORT_DATE_RUN_DESCENDING: int 41 | SORT_EXTENSION_ASCENDING: int 42 | SORT_EXTENSION_DESCENDING: int 43 | SORT_FILE_LIST_FILENAME_ASCENDING: int 44 | SORT_FILE_LIST_FILENAME_DESCENDING: int 45 | SORT_NAME_ASCENDING: int 46 | SORT_NAME_DESCENDING: int 47 | SORT_PATH_ASCENDING: int 48 | SORT_PATH_DESCENDING: int 49 | SORT_RUN_COUNT_ASCENDING: int 50 | SORT_RUN_COUNT_DESCENDING: int 51 | SORT_SIZE_ASCENDING: int 52 | SORT_SIZE_DESCENDING: int 53 | SORT_TYPE_NAME_ASCENDING: int 54 | SORT_TYPE_NAME_DESCENDING: int 55 | TARGET_MACHINE_ARM: int 56 | TARGET_MACHINE_X64: int 57 | TARGET_MACHINE_X86: int 58 | 59 | def CleanUp(*args, **kwargs) -> Any: ... 60 | def DeleteRunHistory(*args, **kwargs) -> Any: ... 61 | def Exit(*args, **kwargs) -> Any: ... 62 | def GetBuildNumber(*args, **kwargs) -> Any: ... 63 | def GetLastError(*args, **kwargs) -> Any: ... 64 | def GetMajorVersion(*args, **kwargs) -> Any: ... 65 | def GetMatchCase(*args, **kwargs) -> Any: ... 66 | def GetMatchPath(*args, **kwargs) -> Any: ... 67 | def GetMatchWholeWord(*args, **kwargs) -> Any: ... 68 | def GetMax(*args, **kwargs) -> Any: ... 69 | def GetMinorVersion(*args, **kwargs) -> Any: ... 70 | def GetNumFileResults(*args, **kwargs) -> Any: ... 71 | def GetNumFolderResults(*args, **kwargs) -> Any: ... 72 | def GetNumResults(*args, **kwargs) -> Any: ... 73 | def GetOffset(*args, **kwargs) -> Any: ... 74 | def GetRegex(*args, **kwargs) -> Any: ... 75 | def GetReplyID(*args, **kwargs) -> Any: ... 76 | def GetReplyWindow(*args, **kwargs) -> Any: ... 77 | def GetRequestFlags(*args, **kwargs) -> Any: ... 78 | def GetResultAttributes(index: int) -> int: ... 79 | def GetResultDateAccessed(index: int) -> datetime.datetime: ... 80 | def GetResultDateCreated(index: int) -> datetime.datetime: ... 81 | def GetResultDateModified(index: int) -> datetime.datetime: ... 82 | def GetResultDateRecentlyChanged(index: int) -> datetime.datetime: ... 83 | def GetResultDateRun(index: int) -> datetime.datetime: ... 84 | def GetResultExtension(index: int) -> str: ... 85 | def GetResultFileListFileName(index: int) -> str: ... 86 | def GetResultFileName(index: int) -> str: ... 87 | def GetResultFullPathName(index: int, max_path_length: int = ...) -> str: ... 88 | def GetResultHighlightedFileName(index: int) -> str: ... 89 | def GetResultHighlightedFullPathAndFileName(index: int) -> str: ... 90 | def GetResultHighlightedPath(index: int) -> str: ... 91 | def GetResultListRequestFlags(*args, **kwargs) -> Any: ... 92 | def GetResultListSort(*args, **kwargs) -> Any: ... 93 | def GetResultPath(index: int) -> str: ... 94 | def GetResultRunCount(index: int) -> int: ... 95 | def GetResultSize(index: int) -> union_LARGE_INTEGER: ... 96 | def GetRevision(*args, **kwargs) -> Any: ... 97 | def GetRunCountFromFileName(filepath: str) -> int: ... 98 | def GetSearch(*args, **kwargs) -> Any: ... 99 | def GetSort(*args, **kwargs) -> Any: ... 100 | def GetTargetMachine(*args, **kwargs) -> Any: ... 101 | def GetTotFileResults(*args, **kwargs) -> Any: ... 102 | def GetTotFolderResults(*args, **kwargs) -> Any: ... 103 | def GetTotResults(*args, **kwargs) -> Any: ... 104 | def IncRunCountFromFileName(filepath: str) -> int: ... 105 | def IsAdmin(*args, **kwargs) -> Any: ... 106 | def IsAppData(*args, **kwargs) -> Any: ... 107 | def IsDBLoaded(*args, **kwargs) -> Any: ... 108 | def IsFileResult(arg0: int) -> int: ... 109 | def IsFolderResult(arg0: int) -> int: ... 110 | def IsQueryReply(message: int, wparam: int, lparam: int, dwID: int) -> int: ... 111 | def IsVolumeResult(arg0: int) -> int: ... 112 | def Query(wait: bool = ...) -> None: ... 113 | def RebuildDB(*args, **kwargs) -> Any: ... 114 | def Reset(*args, **kwargs) -> Any: ... 115 | def SaveDB(*args, **kwargs) -> Any: ... 116 | def SaveRunHistory(*args, **kwargs) -> Any: ... 117 | @overload 118 | def SetMatchCase(enable: bool) -> None: ... 119 | @overload 120 | def SetMatchCase(enable: bool) -> None: ... 121 | @overload 122 | def SetMatchCase(*args, **kwargs) -> Any: ... 123 | def SetMatchPath(enable: bool) -> None: ... 124 | def SetMatchWholeWord(enable: bool) -> None: ... 125 | def SetMax(max: int) -> None: ... 126 | def SetOffset(offset: int) -> None: ... 127 | def SetReplyID(reply_id: int) -> None: ... 128 | def SetReplyWindow(reply_window_handle: HWND__) -> None: ... 129 | def SetRequestFlags(request_flags: int) -> None: ... 130 | def SetRunCountFromFileName(filepath: str, runCount: int) -> int: ... 131 | def SetSearch(search_string: str) -> None: ... 132 | def SetSort(sort_mode: int) -> None: ... 133 | def SortResultsByPath(*args, **kwargs) -> Any: ... 134 | def UpdateAllFolderIndexes(*args, **kwargs) -> Any: ... 135 | -------------------------------------------------------------------------------- /PyEverything/_PyEverything/PyEverything.cpp: -------------------------------------------------------------------------------- 1 | // Everything-Python.cpp : This file contains the 'main' function. Program execution begins and ends there. 2 | // 3 | 4 | #ifdef _MSC_VER 5 | #pragma comment(lib, "user32") 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "Everything.h" 14 | #include "pybind11/pybind11.h" 15 | #include "pybind11/chrono.h" 16 | 17 | namespace py = pybind11; 18 | 19 | /* 20 | * Base exception for the everything API 21 | * Future plan is to break out each error code into its own exception so that python API users can catch specific errors that they care about 22 | * (e.g. catching the invalid ipc error to then boot the everything service.) 23 | */ 24 | struct EverythingException : std::exception 25 | { 26 | 27 | const DWORD m_errorCode; 28 | EverythingException(const DWORD& errorCode) : m_errorCode(errorCode) {} 29 | 30 | const std::string errCodeString = std::to_string(this->m_errorCode); 31 | const std::string m_errorMessage = "Everything API returned error code: " + errCodeString; 32 | const char* what() const noexcept { return m_errorMessage.c_str(); } 33 | }; 34 | 35 | /* 36 | Converts the error codes into exceptions that get thrown. 37 | @param status The status returned from various api calls. Most will return a 0 if the function fails. 38 | Gets a bit confusing in cases where the return value is also used as a count, where 0 is a valid value. 39 | */ 40 | template 41 | static inline void checkEverythingErrorCodeAndThrow(const T status) 42 | { 43 | if (status == 0) 44 | { 45 | DWORD errorCode = Everything_GetLastError(); 46 | if (errorCode) 47 | { 48 | //sometimes 0 is a valid status e.g when returning number of result matches. 49 | throw EverythingException(errorCode); 50 | } 51 | } 52 | } 53 | 54 | //the system_clock::time_point conversion uses an unsafe std::localtime function. Disable the warning with _CRT_SECURE_NO_WARNINGS 55 | //Will implement our own FILETIME > datetime conversion function if this causes problems. 56 | 57 | static py::object FILETIMEtoPyObject(const FILETIME& ft) 58 | { 59 | time_t t; 60 | ULARGE_INTEGER ull; 61 | ull.LowPart = ft.dwLowDateTime; 62 | ull.HighPart = ft.dwHighDateTime; 63 | if (ull.QuadPart < 0x8000000000000000) //Max valid FILETIME for FileTimeToSystemTime() https://docs.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-filetimetosystemtime#parameters 64 | { 65 | t = ull.QuadPart / 10000000ULL - 11644473600ULL; //https://cyberspock.com/2015/10/02/some-time_point-to-from-filetime-conversions/ something to do with clock tick resolution and epoch adjustment. Probably not portable. 66 | std::chrono::system_clock::time_point FILETIMEToTimepoint = std::chrono::system_clock::from_time_t(t); 67 | return py::cast(FILETIMEToTimepoint); 68 | } 69 | else 70 | { 71 | return py::none(); 72 | } 73 | } 74 | 75 | void Py_Everything_Cleanup() 76 | { 77 | Everything_CleanUp(); 78 | } 79 | 80 | BOOL Py_Everything_GetMatchPath() 81 | { 82 | return Everything_GetMatchPath(); 83 | } 84 | 85 | BOOL Py_Everything_GetMatchCase() 86 | { 87 | return Everything_GetMatchCase(); 88 | } 89 | 90 | BOOL Py_Everything_GetMatchWholeWord() 91 | { 92 | return Everything_GetMatchWholeWord(); 93 | } 94 | 95 | BOOL Py_Everything_GetRegex() 96 | { 97 | return Everything_GetRegex(); 98 | } 99 | 100 | DWORD Py_Everything_GetMax() 101 | { 102 | return Everything_GetMax(); 103 | } 104 | 105 | DWORD Py_Everything_GetOffset() 106 | { 107 | return Everything_GetOffset(); 108 | } 109 | 110 | std::wstring Py_Everything_GetSearch() 111 | { 112 | auto rv = Everything_GetSearch(); 113 | checkEverythingErrorCodeAndThrow(rv); 114 | return std::wstring(rv); 115 | } 116 | 117 | DWORD Py_Everything_GetLastError() 118 | { 119 | return Everything_GetLastError(); 120 | } 121 | 122 | HWND Py_Everything_GetReplyWindow() 123 | { 124 | return Everything_GetReplyWindow(); 125 | } 126 | 127 | DWORD Py_Everything_GetReplyID() 128 | { 129 | return Everything_GetReplyID(); 130 | } 131 | 132 | DWORD Py_Everything_GetSort() 133 | { 134 | return Everything_GetSort(); 135 | } 136 | 137 | DWORD Py_Everything_GetRequestFlags() 138 | { 139 | return Everything_GetRequestFlags(); 140 | } 141 | 142 | BOOL Py_Everything_IsQueryReply(UINT message, WPARAM wParam, LPARAM lParam, DWORD nID) 143 | { 144 | auto rv = Everything_IsQueryReply(message, wParam, lParam, nID); 145 | checkEverythingErrorCodeAndThrow(rv); 146 | return rv; 147 | } 148 | 149 | void Py_Everything_SortResultsByPath() 150 | { 151 | Everything_SortResultsByPath(); 152 | } 153 | 154 | DWORD Py_Everything_GetNumFileResults(void) 155 | { 156 | DWORD num = Everything_GetNumFileResults(); 157 | checkEverythingErrorCodeAndThrow(num); 158 | return num; 159 | } 160 | 161 | DWORD Py_Everything_GetNumFolderResults(void) 162 | { 163 | DWORD num = Everything_GetNumFolderResults(); 164 | checkEverythingErrorCodeAndThrow(num); 165 | return num; 166 | } 167 | 168 | DWORD Py_Everything_GetNumResults(void) 169 | { 170 | DWORD num = Everything_GetNumResults(); 171 | checkEverythingErrorCodeAndThrow(num); 172 | return num; 173 | } 174 | 175 | DWORD Py_Everything_GetTotFileResults(void) 176 | { 177 | DWORD num = Everything_GetTotFileResults(); 178 | checkEverythingErrorCodeAndThrow(num); 179 | return num; 180 | } 181 | 182 | DWORD Py_Everything_GetTotFolderResults(void) 183 | { 184 | DWORD num = Everything_GetTotFolderResults(); 185 | checkEverythingErrorCodeAndThrow(num); 186 | return num; 187 | } 188 | 189 | DWORD Py_Everything_GetTotResults(void) 190 | { 191 | DWORD num = Everything_GetTotResults(); 192 | checkEverythingErrorCodeAndThrow(num); 193 | return num; 194 | } 195 | 196 | BOOL Py_Everything_IsVolumeResult(DWORD index) 197 | { 198 | BOOL isVolume = Everything_IsVolumeResult(index); 199 | checkEverythingErrorCodeAndThrow(isVolume); 200 | return isVolume; 201 | } 202 | 203 | BOOL Py_Everything_IsFolderResult(DWORD index) 204 | { 205 | BOOL isFolder = Everything_IsFolderResult(index); 206 | checkEverythingErrorCodeAndThrow(isFolder); 207 | return isFolder; 208 | } 209 | 210 | BOOL Py_Everything_IsFileResult(DWORD index) 211 | { 212 | BOOL isFile = Everything_IsFileResult(index); 213 | checkEverythingErrorCodeAndThrow(isFile); 214 | return isFile; 215 | } 216 | 217 | std::wstring Py_Everything_GetResultFileName(DWORD index) 218 | { 219 | auto result = Everything_GetResultFileName(index); 220 | checkEverythingErrorCodeAndThrow(result); 221 | return std::wstring(result); 222 | } 223 | 224 | std::wstring Py_Everything_GetResultPath(DWORD index) 225 | { 226 | auto result = Everything_GetResultPath(index); 227 | checkEverythingErrorCodeAndThrow(result); 228 | return std::wstring(result); 229 | } 230 | 231 | std::wstring Py_Everything_GetResultFullPathName(DWORD index, const DWORD maxCount = MAX_PATH) 232 | { 233 | std::vector buf = std::vector(maxCount); 234 | int ok = Everything_GetResultFullPathName(index, &buf[0], maxCount); 235 | checkEverythingErrorCodeAndThrow(ok); 236 | const std::wstring result = std::wstring(&buf[0]); 237 | return result; 238 | } 239 | 240 | DWORD Py_Everything_GetResultListSort(void) 241 | { 242 | return Everything_GetResultListSort(); 243 | } 244 | 245 | DWORD Py_Everything_GetResultListRequestFlags(void) 246 | { 247 | return Everything_GetResultListRequestFlags(); 248 | } 249 | 250 | std::wstring Py_Everything_GetResultExtension(DWORD index) 251 | { 252 | auto rv = Everything_GetResultExtension(index); 253 | checkEverythingErrorCodeAndThrow(rv); 254 | return std::wstring(rv); 255 | } 256 | 257 | LARGE_INTEGER Py_Everything_GetResultSize(DWORD index) 258 | { 259 | LARGE_INTEGER size; 260 | auto ok = Everything_GetResultSize(index, &size); 261 | checkEverythingErrorCodeAndThrow(ok); 262 | return size; 263 | } 264 | 265 | auto Py_Everything_GetResultDateCreated(DWORD index) 266 | { 267 | FILETIME time; 268 | auto ok = Everything_GetResultDateCreated(index, &time); 269 | checkEverythingErrorCodeAndThrow(ok); 270 | return FILETIMEtoPyObject(time); 271 | } 272 | 273 | auto Py_Everything_GetResultDateModified(DWORD index) 274 | { 275 | FILETIME time; 276 | auto ok = Everything_GetResultDateModified(index, &time); 277 | checkEverythingErrorCodeAndThrow(ok); 278 | return FILETIMEtoPyObject(time); 279 | } 280 | 281 | auto Py_Everything_GetResultDateAccessed(DWORD index) 282 | { 283 | FILETIME time; 284 | auto ok = Everything_GetResultDateAccessed(index, &time); 285 | checkEverythingErrorCodeAndThrow(ok); 286 | return FILETIMEtoPyObject(time); 287 | } 288 | 289 | DWORD Py_Everything_GetResultAttributes(DWORD index) 290 | { 291 | auto rv = Everything_GetResultAttributes(index); 292 | checkEverythingErrorCodeAndThrow(rv); 293 | return rv; 294 | } 295 | 296 | std::wstring Py_Everything_GetResultFileListFileName(DWORD index) 297 | { 298 | auto rv = Everything_GetResultFileListFileName(index); 299 | checkEverythingErrorCodeAndThrow(rv); 300 | return std::wstring(rv); 301 | } 302 | 303 | DWORD Py_Everything_GetResultRunCount(DWORD index) 304 | { 305 | auto rv = Everything_GetResultRunCount(index); 306 | checkEverythingErrorCodeAndThrow(rv); 307 | return rv; 308 | } 309 | 310 | auto Py_Everything_GetResultDateRun(DWORD index) 311 | { 312 | FILETIME time; 313 | auto ok = Everything_GetResultDateRun(index, &time); 314 | checkEverythingErrorCodeAndThrow(ok); 315 | return FILETIMEtoPyObject(time); 316 | } 317 | 318 | auto Py_Everything_GetResultDateRecentlyChanged(DWORD index) 319 | { 320 | FILETIME time; 321 | auto ok = Everything_GetResultDateRecentlyChanged(index, &time); 322 | checkEverythingErrorCodeAndThrow(ok); 323 | return FILETIMEtoPyObject(time); 324 | } 325 | 326 | std::wstring Py_Everything_GetResultHighlightedFileName(DWORD index) 327 | { 328 | auto rv = Everything_GetResultHighlightedFileName(index); 329 | checkEverythingErrorCodeAndThrow(rv); 330 | return std::wstring(rv); 331 | } 332 | 333 | std::wstring Py_Everything_GetResultHighlightedPath(DWORD index) 334 | { 335 | auto rv = Everything_GetResultHighlightedPath(index); 336 | checkEverythingErrorCodeAndThrow(rv); 337 | return std::wstring(rv); 338 | } 339 | 340 | std::wstring Py_Everything_GetResultHighlightedFullPathAndFileName(DWORD index) 341 | { 342 | auto rv = Everything_GetResultHighlightedFullPathAndFileName(index); 343 | checkEverythingErrorCodeAndThrow(rv); 344 | return std::wstring(rv); 345 | } 346 | 347 | void Py_Everything_SetSearch(const std::wstring& searchTerm) 348 | { 349 | Everything_SetSearch(searchTerm.c_str()); 350 | } 351 | 352 | void Py_Everything_SetMatchPath(const bool enable) 353 | { 354 | Everything_SetMatchPath(enable); 355 | } 356 | 357 | void Py_Everything_SetMatchCase(const bool enable) 358 | { 359 | Everything_SetMatchCase(enable); 360 | } 361 | 362 | void Py_Everything_SetMatchWholeWord(const bool enable) 363 | { 364 | Everything_SetMatchWholeWord(enable); 365 | } 366 | 367 | void Py_Everything_SetRegex(const bool enable) 368 | { 369 | Everything_SetRegex(enable); 370 | } 371 | 372 | void Py_Everything_SetReplyWindow(const HWND windowId) 373 | { 374 | Everything_SetReplyWindow(windowId); 375 | } 376 | 377 | void Py_Everything_SetReplyID(const DWORD replyID) 378 | { 379 | Everything_SetReplyID(replyID); 380 | } 381 | 382 | void Py_Everything_SetRequestFlags(const DWORD requestFlags) 383 | { 384 | Everything_SetRequestFlags(requestFlags); 385 | } 386 | 387 | void Py_Everything_SetOffset(DWORD offset) 388 | { 389 | Everything_SetOffset(offset); 390 | } 391 | 392 | void Py_Everything_SetMax(DWORD maxResults) 393 | { 394 | Everything_SetMax(maxResults); 395 | } 396 | 397 | void Py_Everything_SetSort(DWORD sortType) 398 | { 399 | Everything_SetSort(sortType); 400 | } 401 | 402 | void Py_Everything_Query(bool wait = true) 403 | { 404 | int ok = Everything_Query(wait); 405 | checkEverythingErrorCodeAndThrow(ok); 406 | } 407 | 408 | DWORD Py_Everything_GetMajorVersion(void) 409 | { 410 | auto rv = Everything_GetMajorVersion(); 411 | checkEverythingErrorCodeAndThrow(rv); 412 | return rv; 413 | } 414 | 415 | DWORD Py_Everything_GetMinorVersion(void) 416 | { 417 | auto rv = Everything_GetMinorVersion(); 418 | checkEverythingErrorCodeAndThrow(rv); 419 | return rv; 420 | } 421 | 422 | DWORD Py_Everything_GetRevision(void) 423 | { 424 | auto rv = Everything_GetRevision(); 425 | checkEverythingErrorCodeAndThrow(rv); 426 | return rv; 427 | } 428 | 429 | DWORD Py_Everything_GetBuildNumber(void) 430 | { 431 | auto rv = Everything_GetBuildNumber(); 432 | checkEverythingErrorCodeAndThrow(rv); 433 | return rv; 434 | } 435 | 436 | BOOL Py_Everything_Exit(void) 437 | { 438 | auto rv = Everything_Exit(); 439 | checkEverythingErrorCodeAndThrow(rv); 440 | return rv; 441 | } 442 | 443 | BOOL Py_Everything_IsDBLoaded(void) 444 | { 445 | auto rv = Everything_IsDBLoaded(); 446 | checkEverythingErrorCodeAndThrow(rv); 447 | return rv; 448 | } 449 | 450 | BOOL Py_Everything_IsAdmin(void) 451 | { 452 | auto rv = Everything_IsAdmin(); 453 | checkEverythingErrorCodeAndThrow(rv); 454 | return rv; 455 | } 456 | 457 | BOOL Py_Everything_IsAppData(void) 458 | { 459 | auto rv = Everything_IsAppData(); 460 | checkEverythingErrorCodeAndThrow(rv); 461 | return rv; 462 | } 463 | 464 | BOOL Py_Everything_RebuildDB(void) 465 | { 466 | auto rv = Everything_RebuildDB(); 467 | checkEverythingErrorCodeAndThrow(rv); 468 | return rv; 469 | } 470 | 471 | BOOL Py_Everything_UpdateAllFolderIndexes(void) 472 | { 473 | auto rv = Everything_RebuildDB(); 474 | checkEverythingErrorCodeAndThrow(rv); 475 | return rv; 476 | } 477 | 478 | BOOL Py_Everything_SaveDB(void) 479 | { 480 | auto rv = Everything_SaveDB(); 481 | checkEverythingErrorCodeAndThrow(rv); 482 | return rv; 483 | } 484 | 485 | BOOL Py_Everything_SaveRunHistory(void) 486 | { 487 | auto rv = Everything_SaveRunHistory(); 488 | checkEverythingErrorCodeAndThrow(rv); 489 | return rv; 490 | } 491 | 492 | BOOL Py_Everything_DeleteRunHistory(void) 493 | { 494 | auto rv = Everything_DeleteRunHistory(); 495 | checkEverythingErrorCodeAndThrow(rv); 496 | return rv; 497 | } 498 | 499 | DWORD Py_Everything_GetTargetMachine(void) 500 | { 501 | auto rv = Everything_GetTargetMachine(); 502 | checkEverythingErrorCodeAndThrow(rv); 503 | return rv; 504 | } 505 | 506 | DWORD Py_Everything_GetRunCountFromFileName(const std::wstring fileName) 507 | { 508 | auto rv = Everything_GetRunCountFromFileName(fileName.c_str()); 509 | checkEverythingErrorCodeAndThrow(rv); 510 | return rv; 511 | } 512 | 513 | BOOL Py_Everything_SetRunCountFromFileName(const std::wstring fileName, DWORD runCount) 514 | { 515 | auto rv = Everything_SetRunCountFromFileName(fileName.c_str(), runCount); 516 | checkEverythingErrorCodeAndThrow(rv); 517 | return rv; 518 | } 519 | 520 | DWORD Py_Everything_IncRunCountFromFileName(const std::wstring fileName) 521 | { 522 | auto rv = Everything_IncRunCountFromFileName(fileName.c_str()); 523 | checkEverythingErrorCodeAndThrow(rv); 524 | return rv; 525 | } 526 | 527 | 528 | PYBIND11_MODULE(_PyEverything, m) 529 | { 530 | m.doc() = "Everything Python Bindings."; 531 | 532 | //Functions 533 | 534 | //Setting search state 535 | m.def("SetSearch", &Py_Everything_SetSearch, py::arg("search_string")); 536 | m.def("SetMatchPath", &Py_Everything_SetMatchPath, py::arg("enable")); 537 | m.def("SetMatchCase", &Py_Everything_SetMatchCase, py::arg("enable")); 538 | m.def("SetMatchWholeWord", &Py_Everything_SetMatchWholeWord, py::arg("enable")); 539 | m.def("SetMatchCase", &Py_Everything_SetRegex, py::arg("enable")); 540 | m.def("SetMax", &Py_Everything_SetMax, py::arg("max")); 541 | m.def("SetOffset", &Py_Everything_SetOffset, py::arg("offset")); 542 | m.def("SetReplyWindow", &Py_Everything_SetReplyWindow, py::arg("reply_window_handle")); 543 | m.def("SetReplyID", &Py_Everything_SetReplyID, py::arg("reply_id")); 544 | m.def("SetSort", &Py_Everything_SetSort, py::arg("sort_mode")); 545 | m.def("SetRequestFlags", &Py_Everything_SetRequestFlags, py::arg("request_flags")); 546 | 547 | //reading search state 548 | m.def("GetMatchPath", &Py_Everything_GetMatchPath); 549 | m.def("GetMatchCase", &Py_Everything_GetMatchCase); 550 | m.def("GetMatchWholeWord", &Py_Everything_GetMatchWholeWord); 551 | m.def("GetRegex", &Py_Everything_GetRegex); 552 | m.def("GetMax", &Py_Everything_GetMax); 553 | m.def("GetOffset", &Py_Everything_GetOffset); 554 | m.def("GetSearch", &Py_Everything_GetSearch); 555 | m.def("GetLastError", &Py_Everything_GetLastError); 556 | m.def("GetReplyWindow", &Py_Everything_GetReplyWindow); 557 | m.def("GetReplyID", &Py_Everything_GetReplyID); 558 | m.def("GetSort", &Py_Everything_GetSort); 559 | m.def("GetRequestFlags", &Py_Everything_GetRequestFlags); 560 | 561 | m.def("IsQueryReply", &Py_Everything_IsQueryReply, py::arg("message"), py::arg("wparam"), py::arg("lparam"), py::arg("dwID")); 562 | m.def("SortResultsByPath", &Py_Everything_SortResultsByPath); // might actually be deprecated in favour of Everything_SetSort, need to check. 563 | 564 | //reading query results 565 | m.def("GetNumFileResults", &Py_Everything_GetNumFileResults); 566 | m.def("GetNumFolderResults", &Py_Everything_GetNumFolderResults); 567 | m.def("GetNumResults", &Py_Everything_GetNumResults); 568 | m.def("GetTotFileResults", &Py_Everything_GetTotFileResults); 569 | m.def("GetTotFolderResults", &Py_Everything_GetTotFolderResults); 570 | m.def("GetTotResults", &Py_Everything_GetTotResults); 571 | m.def("IsVolumeResult", &Py_Everything_IsVolumeResult); 572 | m.def("IsFolderResult", &Py_Everything_IsFolderResult); 573 | m.def("IsFileResult", &Py_Everything_IsFileResult); 574 | m.def("GetResultFileName", &Py_Everything_GetResultFileName, py::arg("index")); 575 | m.def("GetResultPath", &Py_Everything_GetResultPath, py::arg("index")); 576 | m.def("GetResultFullPathName", &Py_Everything_GetResultFullPathName, py::arg("index"), py::arg_v("max_path_length", (DWORD)MAX_PATH)); 577 | m.def("GetResultListSort", &Py_Everything_GetResultListSort); 578 | m.def("GetResultListRequestFlags", &Py_Everything_GetResultListRequestFlags); 579 | m.def("GetResultExtension", &Py_Everything_GetResultExtension, py::arg("index")); 580 | m.def("GetResultSize", &Py_Everything_GetResultSize, py::arg("index")); 581 | m.def("GetResultDateCreated", &Py_Everything_GetResultDateCreated, py::arg("index")); 582 | m.def("GetResultDateModified", &Py_Everything_GetResultDateModified, py::arg("index")); 583 | m.def("GetResultDateAccessed", &Py_Everything_GetResultDateAccessed, py::arg("index")); 584 | m.def("GetResultAttributes", &Py_Everything_GetResultAttributes, py::arg("index")); 585 | m.def("GetResultFileListFileName", &Py_Everything_GetResultFileListFileName, py::arg("index")); 586 | m.def("GetResultRunCount", &Py_Everything_GetResultRunCount, py::arg("index")); 587 | m.def("GetResultDateRun", &Py_Everything_GetResultDateRun, py::arg("index")); 588 | m.def("GetResultDateRecentlyChanged", &Py_Everything_GetResultDateRecentlyChanged, py::arg("index")); 589 | m.def("GetResultHighlightedFileName", &Py_Everything_GetResultHighlightedFileName, py::arg("index")); 590 | m.def("GetResultHighlightedPath", &Py_Everything_GetResultHighlightedPath, py::arg("index")); 591 | m.def("GetResultHighlightedFullPathAndFileName", &Py_Everything_GetResultHighlightedFullPathAndFileName, py::arg("index")); 592 | 593 | //The big one, run the query with the current search state 594 | m.def("Query", &Py_Everything_Query, py::arg_v("wait", true)); 595 | 596 | m.def("Reset", &Everything_Reset); 597 | m.def("CleanUp", &Everything_CleanUp); 598 | 599 | m.def("GetMajorVersion", &Py_Everything_GetMajorVersion); 600 | m.def("GetMinorVersion", &Py_Everything_GetMinorVersion); 601 | m.def("GetRevision", &Py_Everything_GetRevision); 602 | m.def("GetBuildNumber", &Py_Everything_GetBuildNumber); 603 | m.def("Exit", &Py_Everything_Exit); 604 | m.def("IsDBLoaded", &Py_Everything_IsDBLoaded); 605 | m.def("IsAdmin", &Py_Everything_IsAdmin); 606 | m.def("IsAppData", &Py_Everything_IsAppData); 607 | m.def("RebuildDB", &Py_Everything_RebuildDB); 608 | m.def("UpdateAllFolderIndexes", &Py_Everything_UpdateAllFolderIndexes); 609 | m.def("SaveDB", &Py_Everything_SaveDB); 610 | m.def("SaveRunHistory", &Py_Everything_SaveRunHistory); 611 | m.def("DeleteRunHistory", &Py_Everything_DeleteRunHistory); 612 | m.def("GetTargetMachine", &Py_Everything_GetTargetMachine); 613 | 614 | //whatever run counts are, manipulate them here. 615 | m.def("GetRunCountFromFileName", &Py_Everything_GetRunCountFromFileName, py::arg("filepath")); 616 | m.def("SetRunCountFromFileName", &Py_Everything_SetRunCountFromFileName, py::arg("filepath"), py::arg("runCount")); 617 | m.def("IncRunCountFromFileName", &Py_Everything_IncRunCountFromFileName, py::arg("filepath")); 618 | 619 | //Members 620 | 621 | //error codes 622 | m.attr("EVERYTHING_OK") = py::int_(EVERYTHING_OK); // 0 no error detected 623 | m.attr("EVERYTHING_ERROR_MEMORY") = py::int_(EVERYTHING_ERROR_MEMORY); // 1 out of memory. 624 | m.attr("EVERYTHING_ERROR_IPC") = py::int_(EVERYTHING_ERROR_IPC); // 2 Everything search client is not running 625 | m.attr("EVERYTHING_ERROR_REGISTERCLASSEX") = py::int_(EVERYTHING_ERROR_REGISTERCLASSEX); // 3 unable to register window class. 626 | m.attr("EVERYTHING_ERROR_CREATEWINDOW") = py::int_(EVERYTHING_ERROR_CREATEWINDOW); // 4 unable to create listening window 627 | m.attr("EVERYTHING_ERROR_CREATETHREAD") = py::int_(EVERYTHING_ERROR_CREATETHREAD); // 5 unable to create listening thread 628 | m.attr("EVERYTHING_ERROR_INVALIDINDEX") = py::int_(EVERYTHING_ERROR_INVALIDINDEX); // 6 invalid index 629 | m.attr("EVERYTHING_ERROR_INVALIDCALL") = py::int_(EVERYTHING_ERROR_INVALIDCALL); // 7 invalid call 630 | m.attr("EVERYTHING_ERROR_INVALIDREQUEST") = py::int_(EVERYTHING_ERROR_INVALIDREQUEST); // 8 invalid request data, request data first. 631 | m.attr("EVERYTHING_ERROR_INVALIDPARAMETER") = py::int_(EVERYTHING_ERROR_INVALIDPARAMETER); // 9 bad parameter. 632 | 633 | //Search request flags 634 | m.attr("REQUEST_FILE_NAME") = py::int_(EVERYTHING_REQUEST_FILE_NAME); 635 | m.attr("REQUEST_PATH") = py::int_(EVERYTHING_REQUEST_PATH); 636 | m.attr("REQUEST_FULL_PATH_AND_FILE_NAME") = py::int_(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME); 637 | m.attr("REQUEST_EXTENSION") = py::int_(EVERYTHING_REQUEST_EXTENSION); 638 | m.attr("REQUEST_SIZE") = py::int_(EVERYTHING_REQUEST_SIZE); 639 | m.attr("REQUEST_DATE_CREATED") = py::int_(EVERYTHING_REQUEST_DATE_CREATED); 640 | m.attr("REQUEST_DATE_MODIFIED") = py::int_(EVERYTHING_REQUEST_DATE_MODIFIED); 641 | m.attr("REQUEST_DATE_ACCESSED") = py::int_(EVERYTHING_REQUEST_DATE_ACCESSED); 642 | m.attr("REQUEST_ATTRIBUTES") = py::int_(EVERYTHING_REQUEST_ATTRIBUTES); 643 | m.attr("REQUEST_FILE_LIST_FILE_NAME") = py::int_(EVERYTHING_REQUEST_FILE_LIST_FILE_NAME); 644 | m.attr("REQUEST_RUN_COUNT") = py::int_(EVERYTHING_REQUEST_RUN_COUNT); 645 | m.attr("REQUEST_DATE_RUN") = py::int_(EVERYTHING_REQUEST_DATE_RUN); 646 | m.attr("REQUEST_DATE_RECENTLY_CHANGED") = py::int_(EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED); 647 | m.attr("REQUEST_HIGHLIGHTED_FILE_NAME") = py::int_(EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME); 648 | m.attr("REQUEST_HIGHLIGHTED_PATH") = py::int_(EVERYTHING_REQUEST_HIGHLIGHTED_PATH); 649 | m.attr("REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME") = py::int_(EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME); 650 | 651 | //Result sort flags 652 | m.attr("SORT_NAME_ASCENDING")= py::int_(EVERYTHING_SORT_NAME_ASCENDING); 653 | m.attr("SORT_NAME_DESCENDING") = py::int_(EVERYTHING_SORT_NAME_DESCENDING); 654 | m.attr("SORT_PATH_ASCENDING") = py::int_(EVERYTHING_SORT_PATH_ASCENDING); 655 | m.attr("SORT_PATH_DESCENDING") = py::int_(EVERYTHING_SORT_PATH_DESCENDING); 656 | m.attr("SORT_SIZE_ASCENDING") = py::int_(EVERYTHING_SORT_SIZE_ASCENDING); 657 | m.attr("SORT_SIZE_DESCENDING") = py::int_(EVERYTHING_SORT_SIZE_DESCENDING); 658 | m.attr("SORT_EXTENSION_ASCENDING") = py::int_(EVERYTHING_SORT_EXTENSION_ASCENDING); 659 | m.attr("SORT_EXTENSION_DESCENDING") = py::int_(EVERYTHING_SORT_EXTENSION_DESCENDING); 660 | m.attr("SORT_TYPE_NAME_ASCENDING") = py::int_(EVERYTHING_SORT_TYPE_NAME_ASCENDING); 661 | m.attr("SORT_TYPE_NAME_DESCENDING") = py::int_(EVERYTHING_SORT_TYPE_NAME_DESCENDING); 662 | m.attr("SORT_DATE_CREATED_ASCENDING") = py::int_(EVERYTHING_SORT_DATE_CREATED_ASCENDING); 663 | m.attr("SORT_DATE_CREATED_DESCENDING") = py::int_(EVERYTHING_SORT_DATE_CREATED_DESCENDING); 664 | m.attr("SORT_DATE_MODIFIED_ASCENDING") = py::int_(EVERYTHING_SORT_DATE_MODIFIED_ASCENDING); 665 | m.attr("SORT_DATE_MODIFIED_DESCENDING") = py::int_(EVERYTHING_SORT_DATE_MODIFIED_DESCENDING); 666 | m.attr("SORT_ATTRIBUTES_ASCENDING") = py::int_(EVERYTHING_SORT_ATTRIBUTES_ASCENDING); 667 | m.attr("SORT_ATTRIBUTES_DESCENDING") = py::int_(EVERYTHING_SORT_ATTRIBUTES_DESCENDING); 668 | m.attr("SORT_FILE_LIST_FILENAME_ASCENDING") = py::int_(EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING); 669 | m.attr("SORT_FILE_LIST_FILENAME_DESCENDING") = py::int_(EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING); 670 | m.attr("SORT_RUN_COUNT_ASCENDING") = py::int_(EVERYTHING_SORT_RUN_COUNT_ASCENDING); 671 | m.attr("SORT_RUN_COUNT_DESCENDING") = py::int_(EVERYTHING_SORT_RUN_COUNT_DESCENDING); 672 | m.attr("SORT_DATE_RECENTLY_CHANGED_ASCENDING") = py::int_(EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING); 673 | m.attr("SORT_DATE_RECENTLY_CHANGED_DESCENDING") = py::int_(EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING); 674 | m.attr("SORT_DATE_ACCESSED_ASCENDING") = py::int_(EVERYTHING_SORT_DATE_ACCESSED_ASCENDING); 675 | m.attr("SORT_DATE_ACCESSED_DESCENDING") = py::int_(EVERYTHING_SORT_DATE_ACCESSED_DESCENDING); 676 | m.attr("SORT_DATE_RUN_ASCENDING") = py::int_(EVERYTHING_SORT_DATE_RUN_ASCENDING); 677 | m.attr("SORT_DATE_RUN_DESCENDING") = py::int_(EVERYTHING_SORT_DATE_RUN_DESCENDING); 678 | 679 | //Target Machine flags 680 | 681 | m.attr("TARGET_MACHINE_X86") = py::int_(EVERYTHING_TARGET_MACHINE_X86); 682 | m.attr("TARGET_MACHINE_X64") = py::int_(EVERYTHING_TARGET_MACHINE_X64); 683 | m.attr("TARGET_MACHINE_ARM") = py::int_(EVERYTHING_TARGET_MACHINE_ARM); 684 | 685 | } -------------------------------------------------------------------------------- /PyEverything/_PyEverything/vendor/Everything-SDK/include/Everything.h: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // Copyright (C) 2016 David Carpenter 4 | // 5 | // Permission is hereby granted, free of charge, 6 | // to any person obtaining a copy of this software 7 | // and associated documentation files (the "Software"), 8 | // to deal in the Software without restriction, 9 | // including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, 11 | // and/or sell copies of the Software, and to permit 12 | // persons to whom the Software is furnished to do so, 13 | // subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 22 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | // 26 | 27 | #ifndef _EVERYTHING_DLL_ 28 | #define _EVERYTHING_DLL_ 29 | 30 | #ifndef _INC_WINDOWS 31 | #include 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define EVERYTHING_OK 0 // no error detected 39 | #define EVERYTHING_ERROR_MEMORY 1 // out of memory. 40 | #define EVERYTHING_ERROR_IPC 2 // Everything search client is not running 41 | #define EVERYTHING_ERROR_REGISTERCLASSEX 3 // unable to register window class. 42 | #define EVERYTHING_ERROR_CREATEWINDOW 4 // unable to create listening window 43 | #define EVERYTHING_ERROR_CREATETHREAD 5 // unable to create listening thread 44 | #define EVERYTHING_ERROR_INVALIDINDEX 6 // invalid index 45 | #define EVERYTHING_ERROR_INVALIDCALL 7 // invalid call 46 | #define EVERYTHING_ERROR_INVALIDREQUEST 8 // invalid request data, request data first. 47 | #define EVERYTHING_ERROR_INVALIDPARAMETER 9 // bad parameter. 48 | 49 | #define EVERYTHING_SORT_NAME_ASCENDING 1 50 | #define EVERYTHING_SORT_NAME_DESCENDING 2 51 | #define EVERYTHING_SORT_PATH_ASCENDING 3 52 | #define EVERYTHING_SORT_PATH_DESCENDING 4 53 | #define EVERYTHING_SORT_SIZE_ASCENDING 5 54 | #define EVERYTHING_SORT_SIZE_DESCENDING 6 55 | #define EVERYTHING_SORT_EXTENSION_ASCENDING 7 56 | #define EVERYTHING_SORT_EXTENSION_DESCENDING 8 57 | #define EVERYTHING_SORT_TYPE_NAME_ASCENDING 9 58 | #define EVERYTHING_SORT_TYPE_NAME_DESCENDING 10 59 | #define EVERYTHING_SORT_DATE_CREATED_ASCENDING 11 60 | #define EVERYTHING_SORT_DATE_CREATED_DESCENDING 12 61 | #define EVERYTHING_SORT_DATE_MODIFIED_ASCENDING 13 62 | #define EVERYTHING_SORT_DATE_MODIFIED_DESCENDING 14 63 | #define EVERYTHING_SORT_ATTRIBUTES_ASCENDING 15 64 | #define EVERYTHING_SORT_ATTRIBUTES_DESCENDING 16 65 | #define EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING 17 66 | #define EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING 18 67 | #define EVERYTHING_SORT_RUN_COUNT_ASCENDING 19 68 | #define EVERYTHING_SORT_RUN_COUNT_DESCENDING 20 69 | #define EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING 21 70 | #define EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING 22 71 | #define EVERYTHING_SORT_DATE_ACCESSED_ASCENDING 23 72 | #define EVERYTHING_SORT_DATE_ACCESSED_DESCENDING 24 73 | #define EVERYTHING_SORT_DATE_RUN_ASCENDING 25 74 | #define EVERYTHING_SORT_DATE_RUN_DESCENDING 26 75 | 76 | #define EVERYTHING_REQUEST_FILE_NAME 0x00000001 77 | #define EVERYTHING_REQUEST_PATH 0x00000002 78 | #define EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME 0x00000004 79 | #define EVERYTHING_REQUEST_EXTENSION 0x00000008 80 | #define EVERYTHING_REQUEST_SIZE 0x00000010 81 | #define EVERYTHING_REQUEST_DATE_CREATED 0x00000020 82 | #define EVERYTHING_REQUEST_DATE_MODIFIED 0x00000040 83 | #define EVERYTHING_REQUEST_DATE_ACCESSED 0x00000080 84 | #define EVERYTHING_REQUEST_ATTRIBUTES 0x00000100 85 | #define EVERYTHING_REQUEST_FILE_LIST_FILE_NAME 0x00000200 86 | #define EVERYTHING_REQUEST_RUN_COUNT 0x00000400 87 | #define EVERYTHING_REQUEST_DATE_RUN 0x00000800 88 | #define EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED 0x00001000 89 | #define EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME 0x00002000 90 | #define EVERYTHING_REQUEST_HIGHLIGHTED_PATH 0x00004000 91 | #define EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME 0x00008000 92 | 93 | #define EVERYTHING_TARGET_MACHINE_X86 1 94 | #define EVERYTHING_TARGET_MACHINE_X64 2 95 | #define EVERYTHING_TARGET_MACHINE_ARM 3 96 | 97 | #ifndef EVERYTHINGAPI 98 | #define EVERYTHINGAPI __stdcall 99 | #endif 100 | 101 | #ifndef EVERYTHINGUSERAPI 102 | #define EVERYTHINGUSERAPI __declspec(dllimport) 103 | #endif 104 | 105 | // write search state 106 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString); 107 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString); 108 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable); 109 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable); 110 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable); 111 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRegex(BOOL bEnable); 112 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMax(DWORD dwMax); 113 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset); 114 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd); 115 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetReplyID(DWORD dwId); 116 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSort(DWORD dwSort); // Everything 1.4.1 117 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRequestFlags(DWORD dwRequestFlags); // Everything 1.4.1 118 | 119 | // read search state 120 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchPath(void); 121 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchCase(void); 122 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(void); 123 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetRegex(void); 124 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMax(void); 125 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetOffset(void); 126 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetSearchA(void); 127 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetSearchW(void); 128 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetLastError(void); 129 | EVERYTHINGUSERAPI HWND EVERYTHINGAPI Everything_GetReplyWindow(void); 130 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetReplyID(void); 131 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetSort(void); // Everything 1.4.1 132 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRequestFlags(void); // Everything 1.4.1 133 | 134 | // execute query 135 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait); 136 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait); 137 | 138 | // query reply 139 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD dwId); 140 | 141 | // write result state 142 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SortResultsByPath(void); 143 | 144 | // read result state 145 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFileResults(void); 146 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFolderResults(void); 147 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumResults(void); 148 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFileResults(void); 149 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFolderResults(void); 150 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotResults(void); 151 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsVolumeResult(DWORD dwIndex); 152 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFolderResult(DWORD dwIndex); 153 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFileResult(DWORD dwIndex); 154 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(DWORD dwIndex); 155 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(DWORD dwIndex); 156 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD dwIndex); 157 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultPathA(DWORD dwIndex); 158 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameA(DWORD dwIndex,LPSTR buf,DWORD bufsize); 159 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameW(DWORD dwIndex,LPWSTR wbuf,DWORD wbuf_size_in_wchars); 160 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListSort(void); // Everything 1.4.1 161 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListRequestFlags(void); // Everything 1.4.1 162 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultExtensionW(DWORD dwIndex); // Everything 1.4.1 163 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultExtensionA(DWORD dwIndex); // Everything 1.4.1 164 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultSize(DWORD dwIndex,LARGE_INTEGER *lpSize); // Everything 1.4.1 165 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateCreated(DWORD dwIndex,FILETIME *lpDateCreated); // Everything 1.4.1 166 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateModified(DWORD dwIndex,FILETIME *lpDateModified); // Everything 1.4.1 167 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateAccessed(DWORD dwIndex,FILETIME *lpDateAccessed); // Everything 1.4.1 168 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultAttributes(DWORD dwIndex); // Everything 1.4.1 169 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileListFileNameW(DWORD dwIndex); // Everything 1.4.1 170 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileListFileNameA(DWORD dwIndex); // Everything 1.4.1 171 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultRunCount(DWORD dwIndex); // Everything 1.4.1 172 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateRun(DWORD dwIndex,FILETIME *lpDateRun); 173 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateRecentlyChanged(DWORD dwIndex,FILETIME *lpDateRecentlyChanged); 174 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameW(DWORD dwIndex); // Everything 1.4.1 175 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameA(DWORD dwIndex); // Everything 1.4.1 176 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedPathW(DWORD dwIndex); // Everything 1.4.1 177 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedPathA(DWORD dwIndex); // Everything 1.4.1 178 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameW(DWORD dwIndex); // Everything 1.4.1 179 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameA(DWORD dwIndex); // Everything 1.4.1 180 | 181 | // reset state and free any allocated memory 182 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_Reset(void); 183 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_CleanUp(void); 184 | 185 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMajorVersion(void); 186 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMinorVersion(void); 187 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRevision(void); 188 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetBuildNumber(void); 189 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_Exit(void); 190 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsDBLoaded(void); // Everything 1.4.1 191 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsAdmin(void); // Everything 1.4.1 192 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsAppData(void); // Everything 1.4.1 193 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_RebuildDB(void); // Everything 1.4.1 194 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_UpdateAllFolderIndexes(void); // Everything 1.4.1 195 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SaveDB(void); // Everything 1.4.1 196 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SaveRunHistory(void); // Everything 1.4.1 197 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_DeleteRunHistory(void); // Everything 1.4.1 198 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTargetMachine(void); // Everything 1.4.1 199 | 200 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameW(LPCWSTR lpFileName); // Everything 1.4.1 201 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameA(LPCSTR lpFileName); // Everything 1.4.1 202 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameW(LPCWSTR lpFileName,DWORD dwRunCount); // Everything 1.4.1 203 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameA(LPCSTR lpFileName,DWORD dwRunCount); // Everything 1.4.1 204 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameW(LPCWSTR lpFileName); // Everything 1.4.1 205 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameA(LPCSTR lpFileName); // Everything 1.4.1 206 | 207 | #ifdef UNICODE 208 | #define Everything_SetSearch Everything_SetSearchW 209 | #define Everything_GetSearch Everything_GetSearchW 210 | #define Everything_Query Everything_QueryW 211 | #define Everything_Query2 Everything_Query2W 212 | #define Everything_GetResultFileName Everything_GetResultFileNameW 213 | #define Everything_GetResultPath Everything_GetResultPathW 214 | #define Everything_GetResultFullPathName Everything_GetResultFullPathNameW 215 | #define Everything_GetResultExtension Everything_GetResultExtensionW 216 | #define Everything_GetResultFileListFileName Everything_GetResultFileListFileNameW 217 | #define Everything_GetResultHighlightedFileName Everything_GetResultHighlightedFileNameW 218 | #define Everything_GetResultHighlightedPath Everything_GetResultHighlightedPathW 219 | #define Everything_GetResultHighlightedFullPathAndFileName Everything_GetResultHighlightedFullPathAndFileNameW 220 | #define Everything_GetRunCountFromFileName Everything_GetRunCountFromFileNameW 221 | #define Everything_SetRunCountFromFileName Everything_SetRunCountFromFileNameW 222 | #define Everything_IncRunCountFromFileName Everything_IncRunCountFromFileNameW 223 | #else 224 | #define Everything_SetSearch Everything_SetSearchA 225 | #define Everything_GetSearch Everything_GetSearchA 226 | #define Everything_Query Everything_QueryA 227 | #define Everything_Query2 Everything_Query2A 228 | #define Everything_GetResultFileName Everything_GetResultFileNameA 229 | #define Everything_GetResultPath Everything_GetResultPathA 230 | #define Everything_GetResultFullPathName Everything_GetResultFullPathNameA 231 | #define Everything_GetResultExtension Everything_GetResultExtensionA 232 | #define Everything_GetResultFileListFileName Everything_GetResultFileListFileNameA 233 | #define Everything_GetResultHighlightedFileName Everything_GetResultHighlightedFileNameA 234 | #define Everything_GetResultHighlightedPath Everything_GetResultHighlightedPathA 235 | #define Everything_GetResultHighlightedFullPathAndFileName Everything_GetResultHighlightedFullPathAndFileNameA 236 | #define Everything_GetRunCountFromFileName Everything_GetRunCountFromFileNameA 237 | #define Everything_SetRunCountFromFileName Everything_SetRunCountFromFileNameA 238 | #define Everything_IncRunCountFromFileName Everything_IncRunCountFromFileNameA 239 | #endif 240 | 241 | #ifdef __cplusplus 242 | } 243 | #endif 244 | 245 | #endif 246 | 247 | -------------------------------------------------------------------------------- /PyEverything/_PyEverything/vendor/Everything-SDK/ipc/everything_ipc.h: -------------------------------------------------------------------------------- 1 | 2 | // Everything IPC 3 | 4 | #ifndef _EVERYTHING_IPC_H_ 5 | #define _EVERYTHING_IPC_H_ 6 | 7 | // C 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define EVERYTHING_WM_IPC (WM_USER) 13 | 14 | #define EVERYTHING_IPC_TARGET_MACHINE_X86 1 15 | #define EVERYTHING_IPC_TARGET_MACHINE_X64 2 16 | #define EVERYTHING_IPC_TARGET_MACHINE_ARM 3 17 | 18 | // built in filters 19 | #define EVERYTHING_IPC_FILTER_EVERYTHING 0 20 | #define EVERYTHING_IPC_FILTER_AUDIO 1 21 | #define EVERYTHING_IPC_FILTER_COMPRESSED 2 22 | #define EVERYTHING_IPC_FILTER_DOCUMENT 3 23 | #define EVERYTHING_IPC_FILTER_EXECUTABLE 4 24 | #define EVERYTHING_IPC_FILTER_FOLDER 5 25 | #define EVERYTHING_IPC_FILTER_PICTURE 6 26 | #define EVERYTHING_IPC_FILTER_VIDEO 7 27 | #define EVERYTHING_IPC_FILTER_CUSTOM 8 28 | 29 | // EVERYTHING_WM_IPC (send to the Everything taskbar notification window) 30 | // the Everything taskbar notification window is always created when Everything is running. (even when the taskbar notification icon is hidden) 31 | // HWND everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 32 | // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_*,lParam) 33 | // version format: major.minor.revision.build 34 | // example: 1.1.4.309 35 | #define EVERYTHING_IPC_GET_MAJOR_VERSION 0 // int major_version = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_MAJOR_VERSION,0); 36 | #define EVERYTHING_IPC_GET_MINOR_VERSION 1 // int minor_version = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_MINOR_VERSION,0); 37 | #define EVERYTHING_IPC_GET_REVISION 2 // int revision = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_REVISION,0); 38 | #define EVERYTHING_IPC_GET_BUILD_NUMBER 3 // int build = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_BUILD,0); 39 | #define EVERYTHING_IPC_EXIT 4 // returns 1 if the program closes. 40 | #define EVERYTHING_IPC_GET_TARGET_MACHINE 5 // int target_machine = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_TARGET_MACHINE,0); returns 0 if not supported. returns a EVERYTHING_IPC_TARGET_MACHINE_* value. requires Everything 1.4.1 41 | 42 | // uninstall options 43 | #define EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS 100 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS,0); 44 | #define EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT 101 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT,0); 45 | #define EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT 102 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT,0); 46 | #define EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU 103 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU,0); 47 | #define EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP 104 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP,0); 48 | #define EVERYTHING_IPC_DELETE_URL_PROTOCOL 105 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_URL_PROTOCOL,0); 49 | 50 | // install options 51 | #define EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS 200 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS,0); 52 | #define EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT 201 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT,0); 53 | #define EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT 202 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT,0); 54 | #define EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU 203 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU,0); 55 | #define EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP 204 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP,0); 56 | #define EVERYTHING_IPC_CREATE_URL_PROTOCOL 205 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_URL_PROTOCOL,0); 57 | 58 | // get option status; 0 = no, 1 = yes, 2 = indeterminate (partially installed) 59 | #define EVERYTHING_IPC_IS_START_MENU_SHORTCUTS 300 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_START_MENU_SHORTCUTS,0); 60 | #define EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT 301 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT,0); 61 | #define EVERYTHING_IPC_IS_DESKTOP_SHORTCUT 302 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DESKTOP_SHORTCUT,0); 62 | #define EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU 303 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU,0); 63 | #define EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP 304 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP,0); 64 | #define EVERYTHING_IPC_IS_URL_PROTOCOL 305 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_URL_PROTOCOL,0); 65 | #define EVERYTHING_IPC_IS_SERVICE 306 // int ret = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_SERVICE,0); 66 | 67 | // indexing 68 | #define EVERYTHING_IPC_IS_NTFS_DRIVE_INDEXED 400 // int is_indexed = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_NTFS_DRIVE_INDEXED,drive_index); drive_index: 0-25 = 0=A:, 1=B:, 2=C:... 69 | 70 | // requires Everything 1.4: 71 | #define EVERYTHING_IPC_IS_DB_LOADED 401 // int is_db_loaded = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DB_LOADED,0); 72 | #define EVERYTHING_IPC_IS_DB_BUSY 402 // int is_db_busy = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DB_BUSY,0); // db is busy, issueing another action will cancel the current one (if possible). 73 | #define EVERYTHING_IPC_IS_ADMIN 403 // int is_admin = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_ADMIN,0); 74 | #define EVERYTHING_IPC_IS_APPDATA 404 // int is_appdata = (int)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_APPDATA,0); 75 | #define EVERYTHING_IPC_REBUILD_DB 405 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_REBUILD,0); // forces all indexes to be rescanned. 76 | #define EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES 406 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES,0); // rescan all folder indexes. 77 | #define EVERYTHING_IPC_SAVE_DB 407 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_SAVE_DB,0); // save the db to disk. 78 | #define EVERYTHING_IPC_SAVE_RUN_HISTORY 408 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_SAVE_RUN_HISTORY,0); // save run history to disk. 79 | #define EVERYTHING_IPC_DELETE_RUN_HISTORY 409 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_RUN_HISTORY,0); // deletes all run history from memory and disk. 80 | #define EVERYTHING_IPC_IS_FAST_SORT 410 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FAST_SORT,EVERYTHING_IPC_SORT_*); // is the sort information indexed? 81 | #define EVERYTHING_IPC_IS_FILE_INFO_INDEXED 411 // SendMessage(everything_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FILE_INFO_INDEXED,EVERYTHING_IPC_FILE_INFO_*); // is the file info indexed? 82 | 83 | // send the following to an existing Everything search window (requires Everything 1.4.1) 84 | // SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_*,0); 85 | #define EVERYTHING_IPC_IS_MATCH_CASE 500 // int is_match_case = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_CASE,0); 86 | #define EVERYTHING_IPC_IS_MATCH_WHOLE_WORD 501 // int is_match_whole_words = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_WHOLE_WORD,0); 87 | #define EVERYTHING_IPC_IS_MATCH_PATH 502 // int is_match_path = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_PATH,0); 88 | #define EVERYTHING_IPC_IS_MATCH_DIACRITICS 503 // int is_match_diacritics = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_DIACRITICS,0); 89 | #define EVERYTHING_IPC_IS_REGEX 504 // int is_regex = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_REGEX,0); 90 | #define EVERYTHING_IPC_IS_FILTERS 505 // int is_filters = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FILTERS,0); 91 | #define EVERYTHING_IPC_IS_PREVIEW 506 // int is_preview = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_PREVIEW,0); 92 | #define EVERYTHING_IPC_IS_STATUS_BAR 507 // int is_status_bar = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_STATUS_BAR,0); 93 | #define EVERYTHING_IPC_IS_DETAILS 508 // int is_details = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DETAILS,0); 94 | #define EVERYTHING_IPC_GET_THUMBNAIL_SIZE 509 // int thumbnail_size = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_GET_THUMBNAIL_SIZE,0); 0 = details 95 | #define EVERYTHING_IPC_GET_SORT 510 // int sort = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_GET_SORT,0); sort can be one of EVERYTHING_IPC_SORT_* types. 96 | #define EVERYTHING_IPC_GET_ON_TOP 511 // int on_top = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_ON_TOP,0); 0=never, 1=always, 2=while searching. 97 | #define EVERYTHING_IPC_GET_FILTER 512 // int filter = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_FILTER,0); filter can be one of EVERYTHING_IPC_FILTER_* types. 98 | #define EVERYTHING_IPC_GET_FILTER_INDEX 513 // int filter_index = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_FILTER_INDEX,0); 99 | 100 | // command IDs to send to an Everything search window. 101 | // SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),WM_COMMAND,MAKEWPARAM(EVERYTHING_IPC_ID_*,0),0); 102 | 103 | // main menus 104 | 105 | #define EVERYTHING_IPC_ID_FILE_MENU 10001 106 | #define EVERYTHING_IPC_ID_EDIT_MENU 10002 107 | #define EVERYTHING_IPC_ID_SEARCH_MENU 10003 108 | #define EVERYTHING_IPC_ID_TOOLS_MENU 10004 109 | #define EVERYTHING_IPC_ID_HELP_MENU 10005 110 | #define EVERYTHING_IPC_ID_TOOLBAR 10006 111 | #define EVERYTHING_IPC_ID_SEARCH_EDIT 10007 112 | #define EVERYTHING_IPC_ID_FILTER 10008 113 | #define EVERYTHING_IPC_ID_RESULTS_HEADER 10009 114 | #define EVERYTHING_IPC_ID_STATUS 10010 115 | #define EVERYTHING_IPC_ID_VIEW_ZOOM_MENU 10012 116 | #define EVERYTHING_IPC_ID_VIEW_MENU 10013 117 | #define EVERYTHING_IPC_ID_VIEW_WINDOW_SIZE_MENU 10019 118 | #define EVERYTHING_IPC_ID_RESULT_LIST 10020 119 | #define EVERYTHING_IPC_ID_BOOKMARKS_MENU 10021 120 | #define EVERYTHING_IPC_ID_VIEW_SORT_BY_MENU 10022 121 | #define EVERYTHING_IPC_ID_VIEW_GOTO_MENU 10024 122 | #define EVERYTHING_IPC_ID_VIEW_ONTOP_MENU 10025 123 | #define EVERYTHING_IPC_ID_PREVIEW 10026 124 | 125 | // TRAY 126 | #define EVERYTHING_IPC_ID_TRAY_NEW_SEARCH_WINDOW 40001 127 | #define EVERYTHING_IPC_ID_TRAY_CONNECT_TO_ETP_SERVER 40004 128 | #define EVERYTHING_IPC_ID_TRAY_OPTIONS 40005 129 | #define EVERYTHING_IPC_ID_TRAY_EXIT 40006 130 | #define EVERYTHING_IPC_ID_TRAY_SHOW_SEARCH_WINDOW 40007 131 | #define EVERYTHING_IPC_ID_TRAY_TOGGLE_SEARCH_WINDOW 40008 132 | 133 | // FILE 134 | #define EVERYTHING_IPC_ID_FILE_NEW_WINDOW 40010 135 | #define EVERYTHING_IPC_ID_FILE_CLOSE 40011 136 | #define EVERYTHING_IPC_ID_FILE_EXPORT 40012 137 | #define EVERYTHING_IPC_ID_FILE_EXIT 40013 138 | #define EVERYTHING_IPC_ID_FILE_OPEN_FILELIST 40014 139 | #define EVERYTHING_IPC_ID_FILE_CLOSE_FILELIST 40015 140 | 141 | // EDIT 142 | #define EVERYTHING_IPC_ID_EDIT_CUT 40020 143 | #define EVERYTHING_IPC_ID_EDIT_COPY 40021 144 | #define EVERYTHING_IPC_ID_EDIT_PASTE 40022 145 | #define EVERYTHING_IPC_ID_EDIT_SELECT_ALL 40023 146 | #define EVERYTHING_IPC_ID_EDIT_INVERT_SELECTION 40029 147 | 148 | // VIEW 149 | #define EVERYTHING_IPC_ID_VIEW_ZOOM_IN 40030 150 | #define EVERYTHING_IPC_ID_VIEW_ZOOM_OUT 40031 151 | #define EVERYTHING_IPC_ID_VIEW_ZOOM_RESET 40032 152 | #define EVERYTHING_IPC_ID_VIEW_TOGGLE_FULLSCREEN 40034 153 | #define EVERYTHING_IPC_ID_VIEW_AUTO_FIT 40044 154 | #define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_1 40045 155 | #define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_2 40046 156 | #define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_3 40047 157 | #define EVERYTHING_IPC_ID_VIEW_REFRESH 40036 158 | #define EVERYTHING_IPC_ID_VIEW_FILTERS 40035 159 | #define EVERYTHING_IPC_ID_VIEW_SORT_BY_ASCENDING 40037 160 | #define EVERYTHING_IPC_ID_VIEW_SORT_BY_DESCENDING 40038 161 | #define EVERYTHING_IPC_ID_VIEW_STATUS_BAR 40039 162 | #define EVERYTHING_IPC_ID_VIEW_GOTO_BACK 40040 163 | #define EVERYTHING_IPC_ID_VIEW_GOTO_FORWARD 40041 164 | #define EVERYTHING_IPC_ID_VIEW_ONTOP_NEVER 40042 165 | #define EVERYTHING_IPC_ID_VIEW_ONTOP_ALWAYS 40043 166 | #define EVERYTHING_IPC_ID_VIEW_ONTOP_WHILE_SEARCHING 40048 167 | #define EVERYTHING_IPC_ID_VIEW_GOTO_HOME 40049 168 | #define EVERYTHING_IPC_ID_VIEW_TOGGLE_LTR_RTL 40050 169 | #define EVERYTHING_IPC_ID_VIEW_DETAILS 40051 170 | #define EVERYTHING_IPC_ID_VIEW_MEDIUM_ICONS 40052 171 | #define EVERYTHING_IPC_ID_VIEW_LARGE_ICONS 40053 172 | #define EVERYTHING_IPC_ID_VIEW_EXTRA_LARGE_ICONS 40054 173 | #define EVERYTHING_IPC_ID_VIEW_PREVIEW 40055 174 | #define EVERYTHING_IPC_ID_VIEW_GOTO_SHOW_ALL_HISTORY 40056 175 | #define EVERYTHING_IPC_ID_VIEW_INCREASE_THUMBNAIL_SIZE 40057 176 | #define EVERYTHING_IPC_ID_VIEW_DECREASE_THUMBNAIL_SIZE 40058 177 | #define EVERYTHING_IPC_ID_VIEW_SHOW_FILTERS 40096 // Everything 1.4.1 178 | #define EVERYTHING_IPC_ID_VIEW_HIDE_FILTERS 40097 // Everything 1.4.1 179 | #define EVERYTHING_IPC_ID_VIEW_SHOW_PREVIEW 40098 // Everything 1.4.1 180 | #define EVERYTHING_IPC_ID_VIEW_HIDE_PREVIEW 40099 // Everything 1.4.1 181 | #define EVERYTHING_IPC_ID_VIEW_SHOW_STATUS_BAR 40100 // Everything 1.4.1 182 | #define EVERYTHING_IPC_ID_VIEW_HIDE_STATUS_BAR 40101 // Everything 1.4.1 183 | #define EVERYTHING_IPC_ID_VIEW_DETAILS_NO_TOGGLE 40102 // Everything 1.4.1 184 | #define EVERYTHING_IPC_ID_VIEW_MEDIUM_ICONS_NO_TOGGLE 40103 // Everything 1.4.1 185 | #define EVERYTHING_IPC_ID_VIEW_LARGE_ICONS_NO_TOGGLE 40104 // Everything 1.4.1 186 | #define EVERYTHING_IPC_ID_VIEW_EXTRA_LARGE_ICONS_NO_TOGGLE 40105 // Everything 1.4.1 187 | 188 | // SEARCH 189 | #define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_CASE 40060 190 | #define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_WHOLE_WORD 40061 191 | #define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_PATH 40062 192 | #define EVERYTHING_IPC_ID_SEARCH_TOGGLE_REGEX 40063 193 | #define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_DIACRITICS 40066 194 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_ADD 40067 195 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_ORGANIZE 40068 196 | #define EVERYTHING_IPC_ID_SEARCH_ADVANCED_SEARCH 40069 197 | #define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_CASE 40106 // Everything 1.4.1 198 | #define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_WHOLE_WORD 40107 // Everything 1.4.1 199 | #define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_PATH 40108 // Everything 1.4.1 200 | #define EVERYTHING_IPC_ID_SEARCH_ENABLE_REGEX 40109 // Everything 1.4.1 201 | #define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_DIACRITICS 40110 // Everything 1.4.1 202 | #define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_CASE 40111 // Everything 1.4.1 203 | #define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_WHOLE_WORD 40112 // Everything 1.4.1 204 | #define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_PATH 40113 // Everything 1.4.1 205 | #define EVERYTHING_IPC_ID_SEARCH_DISABLE_REGEX 40114 // Everything 1.4.1 206 | #define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_DIACRITICS 40115 // Everything 1.4.1 207 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_EVERYTHING 40116 // Everything 1.4.1 208 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_AUDIO 40117 // Everything 1.4.1 209 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_COMPRESSED 40118 // Everything 1.4.1 210 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_DOCUMENT 40119 // Everything 1.4.1 211 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_EXECUTABLE 40120 // Everything 1.4.1 212 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_FOLDER 40121 // Everything 1.4.1 213 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_PICTURE 40122 // Everything 1.4.1 214 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_VIDEO 40123 // Everything 1.4.1 215 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_AUDIO_NO_TOGGLE 40124 // Everything 1.4.1 216 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_COMPRESSED_NO_TOGGLE 40125 // Everything 1.4.1 217 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_DOCUMENT_NO_TOGGLE 40126 // Everything 1.4.1 218 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_EXECUTABLE_NO_TOGGLE 40127 // Everything 1.4.1 219 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_FOLDER_NO_TOGGLE 40128 // Everything 1.4.1 220 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_PICTURE_NO_TOGGLE 40129 // Everything 1.4.1 221 | #define EVERYTHING_IPC_ID_SEARCH_FILTER_VIDEO_NO_TOGGLE 40130 // Everything 1.4.1 222 | 223 | // TOOLS 224 | #define EVERYTHING_IPC_ID_TOOLS_CONNECT_TO_ETP_SERVER 40072 225 | #define EVERYTHING_IPC_ID_TOOLS_DISCONNECT_FROM_ETP_SERVER 40073 226 | #define EVERYTHING_IPC_ID_TOOLS_OPTIONS 40074 227 | #define EVERYTHING_IPC_ID_TOOLS_CONSOLE 40075 228 | #define EVERYTHING_IPC_ID_TOOLS_EDITOR 40076 229 | 230 | // HELP 231 | #define EVERYTHING_IPC_ID_HELP_VIEW_HELP_TOPICS 40080 232 | #define EVERYTHING_IPC_ID_HELP_OPEN_EVERYTHING_WEBSITE 40081 233 | #define EVERYTHING_IPC_ID_HELP_CHECK_FOR_UPDATES 40082 234 | #define EVERYTHING_IPC_ID_HELP_ABOUT_EVERYTHING 40083 235 | #define EVERYTHING_IPC_ID_HELP_SEARCH_SYNTAX 40084 236 | #define EVERYTHING_IPC_ID_HELP_COMMAND_LINE_OPTIONS 40085 237 | #define EVERYTHING_IPC_ID_HELP_REGEX_SYNTAX 40086 238 | #define EVERYTHING_IPC_ID_HELP_DONATE 40087 239 | 240 | // bookmarks 241 | #define EVERYTHING_IPC_ID_BOOKMARK_ADD 40090 242 | #define EVERYTHING_IPC_ID_BOOKMARK_ORGANIZE 40091 243 | #define EVERYTHING_IPC_ID_BOOKMARK_START 44000 244 | #define EVERYTHING_IPC_ID_BOOKMARK_END 45000 // exclusive 245 | 246 | #define EVERYTHING_IPC_ID_FILTER_START 45000 247 | #define EVERYTHING_IPC_ID_FILTER_END 46000 // exclusive 248 | 249 | #define EVERYTHING_IPC_ID_VIEW_GOTO_START 46000 250 | #define EVERYTHING_IPC_ID_VIEW_GOTO_END 47000 // exclusive 251 | 252 | // files 253 | #define EVERYTHING_IPC_ID_FILE_OPEN 41000 254 | #define EVERYTHING_IPC_ID_FILE_OPEN_NEW 41048 255 | #define EVERYTHING_IPC_ID_FILE_OPEN_WITH 41049 256 | #define EVERYTHING_IPC_ID_FILE_EDIT 41050 257 | #define EVERYTHING_IPC_ID_FILE_PLAY 41051 258 | #define EVERYTHING_IPC_ID_FILE_PRINT 41052 259 | #define EVERYTHING_IPC_ID_FILE_PREVIEW 41053 260 | #define EVERYTHING_IPC_ID_FILE_PRINT_TO 41054 261 | #define EVERYTHING_IPC_ID_FILE_RUN_AS 41055 262 | #define EVERYTHING_IPC_ID_FILE_OPEN_WITH_DEFAULT_VERB 41056 263 | #define EVERYTHING_IPC_ID_FILE_OPEN_AND_CLOSE 41057 264 | #define EVERYTHING_IPC_ID_FILE_EXPLORE_PATH 41002 265 | #define EVERYTHING_IPC_ID_FILE_OPEN_PATH 41003 266 | #define EVERYTHING_IPC_ID_FILE_DELETE 41004 267 | #define EVERYTHING_IPC_ID_FILE_PERMANENTLY_DELETE 41005 268 | #define EVERYTHING_IPC_ID_FILE_RENAME 41006 269 | #define EVERYTHING_IPC_ID_FILE_COPY_FULL_PATH_AND_NAME 41007 270 | #define EVERYTHING_IPC_ID_FILE_COPY_PATH 41008 271 | #define EVERYTHING_IPC_ID_FILE_PROPERTIES 41009 272 | #define EVERYTHING_IPC_ID_FILE_READ_EXTENDED_INFORMATION 41064 273 | #define EVERYTHING_IPC_ID_FILE_CREATE_SHORTCUT 41065 274 | #define EVERYTHING_IPC_ID_FILE_SET_RUN_COUNT 41068 275 | #define EVERYTHING_IPC_ID_FILE_COPY_NAME 41011 276 | #define EVERYTHING_IPC_ID_FILE_OPEN_AND_DO_NOT_CLOSE 41076 277 | 278 | // result list 279 | #define EVERYTHING_IPC_ID_RESULT_LIST_EXPLORE 41001 280 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS 41010 281 | #define EVERYTHING_IPC_ID_RESULT_LIST_AUTOFIT_COLUMNS 41012 282 | #define EVERYTHING_IPC_ID_RESULT_LIST_DOWN 41018 283 | #define EVERYTHING_IPC_ID_RESULT_LIST_UP 41019 284 | #define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_UP 41020 285 | #define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_DOWN 41021 286 | #define EVERYTHING_IPC_ID_RESULT_LIST_START 41022 287 | #define EVERYTHING_IPC_ID_RESULT_LIST_END 41023 288 | #define EVERYTHING_IPC_ID_RESULT_LIST_DOWN_EXTEND 41024 289 | #define EVERYTHING_IPC_ID_RESULT_LIST_UP_EXTEND 41025 290 | #define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_UP_EXTEND 41026 291 | #define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_DOWN_EXTEND 41027 292 | #define EVERYTHING_IPC_ID_RESULT_LIST_START_EXTEND 41028 293 | #define EVERYTHING_IPC_ID_RESULT_LIST_END_EXTEND 41029 294 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_DOWN 41030 295 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_UP 41031 296 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_UP 41032 297 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_DOWN 41033 298 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_START 41034 299 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_END 41035 300 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_LEFT 41036 301 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_RIGHT 41037 302 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_LEFT 41038 303 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_RIGHT 41039 304 | #define EVERYTHING_IPC_ID_RESULT_LIST_SELECT_FOCUS 41040 305 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_FOCUS_SELECTION 41041 306 | #define EVERYTHING_IPC_ID_RESULT_LIST_CONTEXT_MENU 41046 307 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_DOWN_EXTEND 41058 308 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_UP_EXTEND 41059 309 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_UP_EXTEND 41060 310 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_DOWN_EXTEND 41061 311 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_START_EXTEND 41062 312 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_END_EXTEND 41063 313 | #define EVERYTHING_IPC_ID_RESULT_LIST_AUTOFIT 41066 314 | #define EVERYTHING_IPC_ID_RESULT_LIST_COPY_CSV 41067 315 | #define EVERYTHING_IPC_ID_RESULT_LIST_LEFT_EXTEND 41070 316 | #define EVERYTHING_IPC_ID_RESULT_LIST_RIGHT_EXTEND 41071 317 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LEFT_EXTEND 41072 318 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_RIGHT_EXTEND 41073 319 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_MOST_RUN 41074 320 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LAST_RUN 41075 321 | #define EVERYTHING_IPC_ID_RESULT_LIST_LEFT 41079 // Everything 1.4.1 322 | #define EVERYTHING_IPC_ID_RESULT_LIST_RIGHT 41080 // Everything 1.4.1 323 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LEFT 41081 // Everything 1.4.1 324 | #define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_RIGHT 41082 // Everything 1.4.1 325 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_LEFT_SCROLL_ONLY 41083 // Everything 1.4.1 326 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_RIGHT_SCROLL_ONLY 41084 // Everything 1.4.1 327 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_LEFT_SCROLL_ONLY 41085 // Everything 1.4.1 328 | #define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_RIGHT_SCROLL_ONLY 41086 // Everything 1.4.1 329 | 330 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_NAME 41300 331 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_PATH 41301 332 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_SIZE 41302 333 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_EXTENSION 41303 334 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_TYPE 41304 335 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_MODIFIED 41305 336 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_CREATED 41306 337 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_ATTRIBUTES 41307 338 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_FILE_LIST_FILENAME 41308 339 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_RUN_COUNT 41309 340 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_RECENTLY_CHANGED 41310 341 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_ACCESSED 41311 342 | #define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_RUN 41312 343 | 344 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_NAME_COLUMN 41400 345 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_PATH_COLUMN 41401 346 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_SIZE_COLUMN 41402 347 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_EXTENSION_COLUMN 41403 348 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_TYPE_COLUMN 41404 349 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_MODIFIED_COLUMN 41405 350 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_CREATED_COLUMN 41406 351 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_ATTRIBUTES_COLUMN 41407 352 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_FILE_LIST_FILENAME_COLUMN 41408 353 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_RUN_COUNT_COLUMN 41409 354 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_RECENTLY_CHANGED_COLUMN 41410 355 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_ACCESSED_COLUMN 41411 356 | #define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_RUN_COLUMN 41412 357 | 358 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_NAME_COLUMN_TO_FIT 41600 359 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_PATH_COLUMN_TO_FIT 41601 360 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_SIZE_COLUMN_TO_FIT 41602 361 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_EXTENSION_COLUMN_TO_FIT 41603 362 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_TYPE_COLUMN_TO_FIT 41604 363 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_MODIFIED_COLUMN_TO_FIT 41605 364 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_CREATED_COLUMN_TO_FIT 41606 365 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_ATTRIBUTES_COLUMN_TO_FIT 41607 366 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_FILE_LIST_FILENAME_COLUMN_TO_FIT 41608 367 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_RUN_COUNT_COLUMN_TO_FIT 41609 368 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_RECENTLY_CHANGED_COLUMN_TO_FIT 41610 369 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_ACCESSED_COLUMN_TO_FIT 41611 370 | #define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_RUN_COLUMN_TO_FIT 41612 371 | 372 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB01 41500 373 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB02 41501 374 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB03 41502 375 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB04 41503 376 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB05 41504 377 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB06 41505 378 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB07 41506 379 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB08 41507 380 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB09 41508 381 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB10 41509 382 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB11 41510 383 | #define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB12 41511 384 | 385 | // search 386 | #define EVERYTHING_IPC_ID_SEARCH_EDIT_FOCUS 42000 387 | #define EVERYTHING_IPC_ID_SEARCH_EDIT_WORD_DELETE_TO_START 42019 388 | #define EVERYTHING_IPC_ID_SEARCH_EDIT_AUTO_COMPLETE 42020 389 | #define EVERYTHING_IPC_ID_SEARCH_EDIT_SHOW_SEARCH_HISTORY 42021 390 | #define EVERYTHING_IPC_ID_SEARCH_EDIT_SHOW_ALL_SEARCH_HISTORY 42022 391 | 392 | #define EVERYTHING_IPC_ID_TRAY_EDITOR 41700 393 | #define EVERYTHING_IPC_ID_TRAY_OPEN_FILELIST 41701 394 | 395 | #define EVERYTHING_IPC_ID_INDEX_UPDATE_ALL_FOLDERS_NOW 41800 396 | #define EVERYTHING_IPC_ID_INDEX_FORCE_REBUILD 41801 397 | 398 | // find the everything IPC window 399 | #define EVERYTHING_IPC_WNDCLASSW L"EVERYTHING_TASKBAR_NOTIFICATION" 400 | #define EVERYTHING_IPC_WNDCLASSA "EVERYTHING_TASKBAR_NOTIFICATION" 401 | 402 | // an Everything search window 403 | #define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSW L"EVERYTHING" 404 | #define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSA "EVERYTHING" 405 | 406 | // this global window message is sent to all top level windows when everything starts. 407 | #define EVERYTHING_IPC_CREATEDW L"EVERYTHING_IPC_CREATED" 408 | #define EVERYTHING_IPC_CREATEDA "EVERYTHING_IPC_CREATED" 409 | 410 | // search flags for querys 411 | #define EVERYTHING_IPC_MATCHCASE 0x00000001 // match case 412 | #define EVERYTHING_IPC_MATCHWHOLEWORD 0x00000002 // match whole word 413 | #define EVERYTHING_IPC_MATCHPATH 0x00000004 // include paths in search 414 | #define EVERYTHING_IPC_REGEX 0x00000008 // enable regex 415 | #define EVERYTHING_IPC_MATCHACCENTS 0x00000010 // match diacritic marks 416 | 417 | // item flags 418 | #define EVERYTHING_IPC_FOLDER 0x00000001 // The item is a folder. (it's a file if not set) 419 | #define EVERYTHING_IPC_DRIVE 0x00000002 // the file or folder is a drive/root. 420 | #define EVERYTHING_IPC_ROOT 0x00000002 // the file or folder is a root. 421 | 422 | typedef struct EVERYTHING_IPC_COMMAND_LINE 423 | { 424 | DWORD show_command; // MUST be one of the SW_* ShowWindow() commands 425 | 426 | // null terminated variable sized command line text in UTF-8. 427 | unsigned char command_line_text[1]; 428 | 429 | }EVERYTHING_IPC_COMMAND_LINE; 430 | 431 | // the WM_COPYDATA message for a query. 432 | #define EVERYTHING_IPC_COPYDATA_COMMAND_LINE_UTF8 0 // Send a EVERYTHING_IPC_COMMAND_LINE structure. 433 | #define EVERYTHING_IPC_COPYDATAQUERYA 1 434 | #define EVERYTHING_IPC_COPYDATAQUERYW 2 435 | 436 | // all results 437 | #define EVERYTHING_IPC_ALLRESULTS 0xFFFFFFFF // all results 438 | 439 | // macro to get the filename of an item 440 | #define EVERYTHING_IPC_ITEMFILENAMEA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMA *)(item))->filename_offset) 441 | #define EVERYTHING_IPC_ITEMFILENAMEW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->filename_offset) 442 | 443 | // macro to get the path of an item 444 | #define EVERYTHING_IPC_ITEMPATHA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMA *)(item))->path_offset) 445 | #define EVERYTHING_IPC_ITEMPATHW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset) 446 | 447 | #pragma pack (push,1) 448 | 449 | // 450 | // Varible sized query struct sent to everything. 451 | // 452 | // sent in the form of a WM_COPYDATA message with EVERYTHING_IPC_COPYDATAQUERY as the 453 | // dwData member in the COPYDATASTRUCT struct. 454 | // set the lpData member of the COPYDATASTRUCT struct to point to your EVERYTHING_IPC_QUERY struct. 455 | // set the cbData member of the COPYDATASTRUCT struct to the size of the 456 | // EVERYTHING_IPC_QUERY struct minus the size of a TCHAR plus the length of the search string in bytes plus 457 | // one TCHAR for the null terminator. 458 | // 459 | // NOTE: to determine the size of this structure use 460 | // ASCII: sizeof(EVERYTHING_IPC_QUERYA) - sizeof(CHAR) + strlen(search_string)*sizeof(CHAR) + sizeof(CHAR) 461 | // UNICODE: sizeof(EVERYTHING_IPC_QUERYW) - sizeof(WCHAR) + wcslen(search_string)*sizeof(WCHAR) + sizeof(WCHAR) 462 | // 463 | // NOTE: Everything will only do one query per window. 464 | // Sending another query when a query has not completed 465 | // will cancel the old query and start the new one. 466 | // 467 | // Everything will send the results to the reply_hwnd in the form of a 468 | // WM_COPYDATA message with the dwData value you specify. 469 | // 470 | // Everything will return TRUE if successful. 471 | // returns FALSE if not supported. 472 | // 473 | // If you query with EVERYTHING_IPC_COPYDATAQUERYW, the results sent from Everything will be Unicode. 474 | // 475 | 476 | typedef struct EVERYTHING_IPC_QUERYW 477 | { 478 | // the window that will receive the new results. 479 | // only 32bits are required to store a window handle. (even on x64) 480 | DWORD reply_hwnd; 481 | 482 | // the value to set the dwData member in the COPYDATASTRUCT struct 483 | // sent by Everything when the query is complete. 484 | DWORD reply_copydata_message; 485 | 486 | // search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH) 487 | DWORD search_flags; 488 | 489 | // only return results after 'offset' results (0 to return from the first result) 490 | // useful for scrollable lists 491 | DWORD offset; 492 | 493 | // the number of results to return 494 | // zero to return no results 495 | // EVERYTHING_IPC_ALLRESULTS to return ALL results 496 | DWORD max_results; 497 | 498 | // null terminated string. variable lengthed search string buffer. 499 | WCHAR search_string[1]; 500 | 501 | }EVERYTHING_IPC_QUERYW; 502 | 503 | // ASCII version 504 | typedef struct EVERYTHING_IPC_QUERYA 505 | { 506 | // the window that will receive the new results. 507 | // only 32bits are required to store a window handle. (even on x64) 508 | DWORD reply_hwnd; 509 | 510 | // the value to set the dwData member in the COPYDATASTRUCT struct 511 | // sent by Everything when the query is complete. 512 | DWORD reply_copydata_message; 513 | 514 | // search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH) 515 | DWORD search_flags; 516 | 517 | // only return results after 'offset' results (0 to return from the first result) 518 | // useful for scrollable lists 519 | DWORD offset; 520 | 521 | // the number of results to return 522 | // zero to return no results 523 | // EVERYTHING_IPC_ALLRESULTS to return ALL results 524 | DWORD max_results; 525 | 526 | // null terminated string. variable lengthed search string buffer. 527 | CHAR search_string[1]; 528 | 529 | }EVERYTHING_IPC_QUERYA; 530 | 531 | // 532 | // Varible sized result list struct received from Everything. 533 | // 534 | // Sent in the form of a WM_COPYDATA message to the hwnd specifed in the 535 | // EVERYTHING_IPC_QUERY struct. 536 | // the dwData member of the COPYDATASTRUCT struct will match the sent 537 | // reply_copydata_message member in the EVERYTHING_IPC_QUERY struct. 538 | // 539 | // make a copy of the data before returning. 540 | // 541 | // return TRUE if you processed the WM_COPYDATA message. 542 | // 543 | 544 | typedef struct EVERYTHING_IPC_ITEMW 545 | { 546 | // item flags 547 | DWORD flags; 548 | 549 | // The offset of the filename from the beginning of the list structure. 550 | // (wchar_t *)((char *)everything_list + everythinglist->name_offset) 551 | DWORD filename_offset; 552 | 553 | // The offset of the filename from the beginning of the list structure. 554 | // (wchar_t *)((char *)everything_list + everythinglist->path_offset) 555 | DWORD path_offset; 556 | 557 | }EVERYTHING_IPC_ITEMW; 558 | 559 | typedef struct EVERYTHING_IPC_ITEMA 560 | { 561 | // item flags 562 | DWORD flags; 563 | 564 | // The offset of the filename from the beginning of the list structure. 565 | // (char *)((char *)everything_list + everythinglist->name_offset) 566 | DWORD filename_offset; 567 | 568 | // The offset of the filename from the beginning of the list structure. 569 | // (char *)((char *)everything_list + everythinglist->path_offset) 570 | DWORD path_offset; 571 | 572 | }EVERYTHING_IPC_ITEMA; 573 | 574 | typedef struct EVERYTHING_IPC_LISTW 575 | { 576 | // the total number of folders found. 577 | DWORD totfolders; 578 | 579 | // the total number of files found. 580 | DWORD totfiles; 581 | 582 | // totfolders + totfiles 583 | DWORD totitems; 584 | 585 | // the number of folders available. 586 | DWORD numfolders; 587 | 588 | // the number of files available. 589 | DWORD numfiles; 590 | 591 | // the number of items available. 592 | DWORD numitems; 593 | 594 | // index offset of the first result in the item list. 595 | DWORD offset; 596 | 597 | // variable lengthed item list. 598 | // use numitems to determine the actual number of items available. 599 | EVERYTHING_IPC_ITEMW items[1]; 600 | 601 | }EVERYTHING_IPC_LISTW; 602 | 603 | typedef struct EVERYTHING_IPC_LISTA 604 | { 605 | // the total number of folders found. 606 | DWORD totfolders; 607 | 608 | // the total number of files found. 609 | DWORD totfiles; 610 | 611 | // totfolders + totfiles 612 | DWORD totitems; 613 | 614 | // the number of folders available. 615 | DWORD numfolders; 616 | 617 | // the number of files available. 618 | DWORD numfiles; 619 | 620 | // the number of items available. 621 | DWORD numitems; 622 | 623 | // index offset of the first result in the item list. 624 | DWORD offset; 625 | 626 | // variable lengthed item list. 627 | // use numitems to determine the actual number of items available. 628 | EVERYTHING_IPC_ITEMA items[1]; 629 | 630 | }EVERYTHING_IPC_LISTA; 631 | 632 | #pragma pack (pop) 633 | 634 | #ifdef UNICODE 635 | #define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYW 636 | #define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEW 637 | #define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHW 638 | #define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYW 639 | #define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMW 640 | #define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTW 641 | #define EVERYTHING_IPC_WNDCLASS EVERYTHING_IPC_WNDCLASSW 642 | #define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSW 643 | #define EVERYTHING_IPC_CREATED EVERYTHING_IPC_CREATEDW 644 | #else 645 | #define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYA 646 | #define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEA 647 | #define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHA 648 | #define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYA 649 | #define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMA 650 | #define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTA 651 | #define EVERYTHING_IPC_WNDCLASS EVERYTHING_IPC_WNDCLASSA 652 | #define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSA 653 | #define EVERYTHING_IPC_CREATED EVERYTHING_IPC_CREATEDA 654 | #endif 655 | 656 | // the WM_COPYDATA message for a query. 657 | // requires Everything 1.4.1 658 | #define EVERYTHING_IPC_COPYDATA_QUERY2A 17 659 | #define EVERYTHING_IPC_COPYDATA_QUERY2W 18 660 | 661 | #define EVERYTHING_IPC_SORT_NAME_ASCENDING 1 662 | #define EVERYTHING_IPC_SORT_NAME_DESCENDING 2 663 | #define EVERYTHING_IPC_SORT_PATH_ASCENDING 3 664 | #define EVERYTHING_IPC_SORT_PATH_DESCENDING 4 665 | #define EVERYTHING_IPC_SORT_SIZE_ASCENDING 5 666 | #define EVERYTHING_IPC_SORT_SIZE_DESCENDING 6 667 | #define EVERYTHING_IPC_SORT_EXTENSION_ASCENDING 7 668 | #define EVERYTHING_IPC_SORT_EXTENSION_DESCENDING 8 669 | #define EVERYTHING_IPC_SORT_TYPE_NAME_ASCENDING 9 670 | #define EVERYTHING_IPC_SORT_TYPE_NAME_DESCENDING 10 671 | #define EVERYTHING_IPC_SORT_DATE_CREATED_ASCENDING 11 672 | #define EVERYTHING_IPC_SORT_DATE_CREATED_DESCENDING 12 673 | #define EVERYTHING_IPC_SORT_DATE_MODIFIED_ASCENDING 13 674 | #define EVERYTHING_IPC_SORT_DATE_MODIFIED_DESCENDING 14 675 | #define EVERYTHING_IPC_SORT_ATTRIBUTES_ASCENDING 15 676 | #define EVERYTHING_IPC_SORT_ATTRIBUTES_DESCENDING 16 677 | #define EVERYTHING_IPC_SORT_FILE_LIST_FILENAME_ASCENDING 17 678 | #define EVERYTHING_IPC_SORT_FILE_LIST_FILENAME_DESCENDING 18 679 | #define EVERYTHING_IPC_SORT_RUN_COUNT_ASCENDING 19 680 | #define EVERYTHING_IPC_SORT_RUN_COUNT_DESCENDING 20 681 | #define EVERYTHING_IPC_SORT_DATE_RECENTLY_CHANGED_ASCENDING 21 682 | #define EVERYTHING_IPC_SORT_DATE_RECENTLY_CHANGED_DESCENDING 22 683 | #define EVERYTHING_IPC_SORT_DATE_ACCESSED_ASCENDING 23 684 | #define EVERYTHING_IPC_SORT_DATE_ACCESSED_DESCENDING 24 685 | #define EVERYTHING_IPC_SORT_DATE_RUN_ASCENDING 25 686 | #define EVERYTHING_IPC_SORT_DATE_RUN_DESCENDING 26 687 | 688 | #define EVERYTHING_IPC_QUERY2_REQUEST_NAME 0x00000001 689 | #define EVERYTHING_IPC_QUERY2_REQUEST_PATH 0x00000002 690 | #define EVERYTHING_IPC_QUERY2_REQUEST_FULL_PATH_AND_NAME 0x00000004 691 | #define EVERYTHING_IPC_QUERY2_REQUEST_EXTENSION 0x00000008 692 | #define EVERYTHING_IPC_QUERY2_REQUEST_SIZE 0x00000010 693 | #define EVERYTHING_IPC_QUERY2_REQUEST_DATE_CREATED 0x00000020 694 | #define EVERYTHING_IPC_QUERY2_REQUEST_DATE_MODIFIED 0x00000040 695 | #define EVERYTHING_IPC_QUERY2_REQUEST_DATE_ACCESSED 0x00000080 696 | #define EVERYTHING_IPC_QUERY2_REQUEST_ATTRIBUTES 0x00000100 697 | #define EVERYTHING_IPC_QUERY2_REQUEST_FILE_LIST_FILE_NAME 0x00000200 698 | #define EVERYTHING_IPC_QUERY2_REQUEST_RUN_COUNT 0x00000400 699 | #define EVERYTHING_IPC_QUERY2_REQUEST_DATE_RUN 0x00000800 700 | #define EVERYTHING_IPC_QUERY2_REQUEST_DATE_RECENTLY_CHANGED 0x00001000 701 | #define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_NAME 0x00002000 702 | #define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_PATH 0x00004000 703 | #define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_FULL_PATH_AND_NAME 0x00008000 704 | 705 | #define EVERYTHING_IPC_FILE_INFO_FILE_SIZE 1 706 | #define EVERYTHING_IPC_FILE_INFO_FOLDER_SIZE 2 707 | #define EVERYTHING_IPC_FILE_INFO_DATE_CREATED 3 708 | #define EVERYTHING_IPC_FILE_INFO_DATE_MODIFIED 4 709 | #define EVERYTHING_IPC_FILE_INFO_DATE_ACCESSED 5 710 | #define EVERYTHING_IPC_FILE_INFO_ATTRIBUTES 6 711 | 712 | #pragma pack (push,1) 713 | 714 | // 715 | // Varible sized query struct sent to everything. 716 | // 717 | // sent in the form of a WM_COPYDATA message with EVERYTHING_IPC_COPYDATA_QUERY2 as the 718 | // dwData member in the COPYDATASTRUCT struct. 719 | // set the lpData member of the COPYDATASTRUCT struct to point to your EVERYTHING_IPC_QUERY struct. 720 | // set the cbData member of the COPYDATASTRUCT struct to the size of the 721 | // EVERYTHING_IPC_QUERY struct minus the size of a TCHAR plus the length of the search string in bytes plus 722 | // one TCHAR for the null terminator. 723 | // 724 | // NOTE: Everything will only do one query per window. 725 | // Sending another query when a query has not completed 726 | // will cancel the old query and start the new one. 727 | // 728 | // Everything will send the results to the reply_hwnd in the form of a 729 | // WM_COPYDATA message with the dwData value you specify. 730 | // 731 | // Everything will return TRUE if successful. 732 | // returns FALSE if not supported. 733 | // 734 | // If you query with EVERYTHING_IPC_COPYDATA_QUERYW, the results sent from Everything will be Unicode. 735 | // 736 | 737 | // ASCII version 738 | typedef struct EVERYTHING_IPC_QUERY2 739 | { 740 | // the window that will receive the new results. 741 | // only 32bits are required to store a window handle. (even on x64) 742 | DWORD reply_hwnd; 743 | 744 | // the value to set the dwData member in the COPYDATASTRUCT struct 745 | // sent by Everything when the query is complete. 746 | DWORD reply_copydata_message; 747 | 748 | // search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH) 749 | DWORD search_flags; 750 | 751 | // only return results after 'offset' results (0 to return from the first result) 752 | // useful for scrollable lists 753 | DWORD offset; 754 | 755 | // the number of results to return 756 | // zero to return no results 757 | // EVERYTHING_IPC_ALLRESULTS to return ALL results 758 | DWORD max_results; 759 | 760 | // request types. 761 | // one or more of EVERYTHING_IPC_QUERY2_REQUEST_* types. 762 | DWORD request_flags; 763 | 764 | // sort type, set to one of EVERYTHING_IPC_SORT_* types. 765 | // set to EVERYTHING_IPC_SORT_NAME_ASCENDING for the best performance (there will never be a performance hit when sorting by name ascending). 766 | // Other sorts will also be instant if the corresponding fast sort is enabled from Tools -> Options -> Indexes. 767 | DWORD sort_type; 768 | 769 | // followed by null terminated search. 770 | // TCHAR search_string[1]; 771 | 772 | }EVERYTHING_IPC_QUERY2; 773 | 774 | typedef struct EVERYTHING_IPC_ITEM2 775 | { 776 | // item flags one of (EVERYTHING_IPC_FOLDER|EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_ROOT) 777 | DWORD flags; 778 | 779 | // offset from the start of the EVERYTHING_IPC_LIST2 struct to the data content 780 | DWORD data_offset; 781 | 782 | // data found at data_offset 783 | // if EVERYTHING_IPC_QUERY2_REQUEST_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text. 784 | // if EVERYTHING_IPC_QUERY2_REQUEST_PATH was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text. 785 | // if EVERYTHING_IPC_QUERY2_REQUEST_FULL_PATH_AND_NAME was set in request_flags, DWORD name_length (excluding the null terminator); followed by null terminated text. 786 | // if EVERYTHING_IPC_QUERY2_REQUEST_SIZE was set in request_flags, LARGE_INTERGER size; 787 | // if EVERYTHING_IPC_QUERY2_REQUEST_EXTENSION was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; 788 | // if EVERYTHING_IPC_QUERY2_REQUEST_TYPE_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; 789 | // if EVERYTHING_IPC_QUERY2_REQUEST_DATE_CREATED was set in request_flags, FILETIME date; 790 | // if EVERYTHING_IPC_QUERY2_REQUEST_DATE_MODIFIED was set in request_flags, FILETIME date; 791 | // if EVERYTHING_IPC_QUERY2_REQUEST_DATE_ACCESSED was set in request_flags, FILETIME date; 792 | // if EVERYTHING_IPC_QUERY2_REQUEST_ATTRIBUTES was set in request_flags, DWORD attributes; 793 | // if EVERYTHING_IPC_QUERY2_REQUEST_FILELIST_FILENAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; 794 | // if EVERYTHING_IPC_QUERY2_REQUEST_RUN_COUNT was set in request_flags, DWORD run_count; 795 | // if EVERYTHING_IPC_QUERY2_REQUEST_DATE_RUN was set in request_flags, FILETIME date; 796 | // if EVERYTHING_IPC_QUERY2_REQUEST_DATE_RECENTLY_CHANGED was set in request_flags, FILETIME date; 797 | // if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text 798 | // if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_PATH was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text 799 | // if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_FULL_PATH_AND_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text 800 | 801 | }EVERYTHING_IPC_ITEM2; 802 | 803 | typedef struct EVERYTHING_IPC_LIST2 804 | { 805 | // number of items found. 806 | DWORD totitems; 807 | 808 | // the number of items available. 809 | DWORD numitems; 810 | 811 | // index offset of the first result in the item list. 812 | DWORD offset; 813 | 814 | // valid request types. 815 | DWORD request_flags; 816 | 817 | // this sort type. 818 | // one of EVERYTHING_IPC_SORT_* types. 819 | // maybe different to requested sort type. 820 | DWORD sort_type; 821 | 822 | // items follow. 823 | // EVERYTHING_IPC_ITEM2 items[numitems] 824 | 825 | // item data follows. 826 | 827 | }EVERYTHING_IPC_LIST2; 828 | 829 | #pragma pack (pop) 830 | 831 | // Get the Run Count for a file, by filename. 832 | // COPYDATASTRUCT cds; 833 | // cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA; 834 | // cds.lpData = TEXT("C:\\folder\\file.txt"); 835 | // cds.cbData = size in bytes of cds.lpData including null terminator. 836 | // SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds); 837 | 838 | #define EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA 19 839 | #define EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTW 20 840 | 841 | #pragma pack (push,1) 842 | 843 | typedef struct EVERYTHING_IPC_RUN_HISTORY 844 | { 845 | DWORD run_count; 846 | 847 | // ansi/wchar filename follows. 848 | // TCHAR filename[]; 849 | 850 | }EVERYTHING_IPC_RUN_HISTORY; 851 | 852 | #pragma pack (pop) 853 | 854 | // Set the Run Count by one for a file, by filename. 855 | // COPYDATASTRUCT cds; 856 | // cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA; 857 | // cds.lpData = (EVERYTHING_IPC_RUN_HISTORY *)run_history; 858 | // cds.cbData = size in bytes of cds.lpData including null terminator. 859 | // SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds); 860 | 861 | #define EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTA 21 862 | #define EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTW 22 863 | 864 | // Increment the Run Count by one for a file, by filename. 865 | // COPYDATASTRUCT cds; 866 | // cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA; 867 | // cds.lpData = TEXT("C:\\folder\\file.txt"); 868 | // cds.cbData = size in bytes of cds.lpData including null terminator. 869 | // SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds); 870 | 871 | #define EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTA 23 872 | #define EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTW 24 873 | 874 | #ifdef UNICODE 875 | #define EVERYTHING_IPC_COPYDATA_QUERY2 EVERYTHING_IPC_COPYDATA_QUERY2W 876 | #define EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_TEXT EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_TEXTW 877 | #define EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_FILTER_TEXT EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_FILTER_TEXTW 878 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_NAMEW 879 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_PATH EVERYTHING_IPC_WM_QUERY_GET_RESULT_PATHW 880 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_FULL_PATH_AND_NAMEW 881 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_NAMEW 882 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_PATH EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_PATHW 883 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_FULL_PATH_AND_NAMEW 884 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_EXTENSION EVERYTHING_IPC_WM_QUERY_GET_RESULT_EXTENSIONW 885 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_LIST_FILE_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_LIST_FILE_NAMEW 886 | #define EVERYTHING_IPC_COPYDATA_QUERY_FIND_NEAREST_STRING_MATCH EVERYTHING_IPC_COPYDATA_QUERY_FIND_NEAREST_STRING_MATCHW 887 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_INFO EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_INFOW 888 | #define EVERYTHING_IPC_WM_QUERY_GET_SELECTION_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_SELECTION_FULL_PATH_AND_NAMEW 889 | #define EVERYTHING_IPC_WM_QUERY_GET_STATUS_TEXT EVERYTHING_IPC_WM_QUERY_GET_STATUS_TEXTW 890 | #define EVERYTHING_IPC_COPYDATA_QUERY_FIND EVERYTHING_IPC_COPYDATA_QUERY_FINDW 891 | #define EVERYTHING_IPC_COPYDATA_QUERY_FOLDER_EXISTS EVERYTHING_IPC_COPYDATA_QUERY_FOLDER_EXISTSW 892 | #define EVERYTHING_IPC_COPYDATA_QUERY_FILE_EXISTS EVERYTHING_IPC_COPYDATA_QUERY_FILE_EXISTSW 893 | #define EVERYTHING_IPC_COPYDATA_QUERY_GET_FILE_ATTRIBUTES EVERYTHING_IPC_COPYDATA_QUERY_GET_FILE_ATTRIBUTESW 894 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_ATTRIBUTES EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_ATTRIBUTESW 895 | #else 896 | #define EVERYTHING_IPC_COPYDATA_QUERY2 EVERYTHING_IPC_COPYDATA_QUERY2A 897 | #define EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_TEXT EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_TEXTA 898 | #define EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_FILTER_TEXT EVERYTHING_IPC_COPYDATA_QUERY_SET_SEARCH_FILTER_TEXTA 899 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_NAMEA 900 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_PATH EVERYTHING_IPC_WM_QUERY_GET_RESULT_PATHA 901 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_FULL_PATH_AND_NAMEA 902 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_NAMEA 903 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_PATH EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_PATHA 904 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_HIGHLIGHTED_FULL_PATH_AND_NAMEA 905 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_EXTENSION EVERYTHING_IPC_WM_QUERY_GET_RESULT_EXTENSIONA 906 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_LIST_FILE_NAME EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_LIST_FILE_NAMEA 907 | #define EVERYTHING_IPC_COPYDATA_QUERY_FIND_NEAREST_STRING_MATCH EVERYTHING_IPC_COPYDATA_QUERY_FIND_NEAREST_STRING_MATCHA 908 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_INFO EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_INFOA 909 | #define EVERYTHING_IPC_WM_QUERY_GET_SELECTION_FULL_PATH_AND_NAME EVERYTHING_IPC_WM_QUERY_GET_SELECTION_FULL_PATH_AND_NAMEA 910 | #define EVERYTHING_IPC_WM_QUERY_GET_STATUS_TEXT EVERYTHING_IPC_WM_QUERY_GET_STATUS_TEXTA 911 | #define EVERYTHING_IPC_COPYDATA_QUERY_FIND EVERYTHING_IPC_COPYDATA_QUERY_FINDA 912 | #define EVERYTHING_IPC_COPYDATA_QUERY_FOLDER_EXISTS EVERYTHING_IPC_COPYDATA_QUERY_FOLDER_EXISTSA 913 | #define EVERYTHING_IPC_COPYDATA_QUERY_FILE_EXISTS EVERYTHING_IPC_COPYDATA_QUERY_FILE_EXISTSA 914 | #define EVERYTHING_IPC_COPYDATA_QUERY_GET_FILE_ATTRIBUTES EVERYTHING_IPC_COPYDATA_QUERY_GET_FILE_ATTRIBUTESA 915 | #define EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_ATTRIBUTES EVERYTHING_IPC_WM_QUERY_GET_RESULT_FILE_ATTRIBUTESA 916 | #endif 917 | 918 | // end extern C 919 | #ifdef __cplusplus 920 | } 921 | #endif 922 | 923 | #endif // _EVERYTHING_H_ 924 | 925 | -------------------------------------------------------------------------------- /PyEverything/_PyEverything/vendor/Everything-SDK/src/Everything.c: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // Copyright (C) 2016 David Carpenter 4 | // 5 | // Permission is hereby granted, free of charge, 6 | // to any person obtaining a copy of this software 7 | // and associated documentation files (the "Software"), 8 | // to deal in the Software without restriction, 9 | // including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, 11 | // and/or sell copies of the Software, and to permit 12 | // persons to whom the Software is furnished to do so, 13 | // subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 22 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | // 26 | 27 | // Notes: 28 | // this project builds the dll (visual studio will also build the lib for us) 29 | // we declare all exported calls to __stdcall, so theres no need to set the default calling standard. 30 | 31 | // disable warnings 32 | #pragma warning(disable : 4996) // deprecation 33 | 34 | #define EVERYTHINGUSERAPI __declspec(dllexport) 35 | 36 | // include 37 | #include "../include/Everything.h" 38 | #include "../ipc/Everything_IPC.h" 39 | 40 | // return copydata code 41 | #define _EVERYTHING_COPYDATA_QUERYREPLY 0 42 | 43 | #define _EVERYTHING_MSGFLT_ALLOW 1 44 | 45 | typedef struct _EVERYTHING_tagCHANGEFILTERSTRUCT 46 | { 47 | DWORD cbSize; 48 | DWORD ExtStatus; 49 | }_EVERYTHING_CHANGEFILTERSTRUCT, *_EVERYTHING_PCHANGEFILTERSTRUCT; 50 | 51 | static void *_Everything_Alloc(DWORD size); 52 | static void _Everything_Free(void *ptr); 53 | static void _Everything_Initialize(void); 54 | static void _Everything_Lock(void); 55 | static void _Everything_Unlock(void); 56 | static DWORD _Everything_StringLengthA(LPCSTR start); 57 | static DWORD _Everything_StringLengthW(LPCWSTR start); 58 | static BOOL EVERYTHINGAPI _Everything_Query(void); 59 | static BOOL _Everything_ShouldUseVersion2(void); 60 | static BOOL _Everything_SendIPCQuery(void); 61 | static BOOL _Everything_SendIPCQuery2(HWND everything_hwnd); 62 | static void _Everything_FreeLists(void); 63 | static BOOL _Everything_IsValidResultIndex(DWORD dwIndex); 64 | static void *_Everything_GetRequestData(DWORD dwIndex,DWORD dwRequestType); 65 | static BOOL _Everything_IsSchemeNameW(LPCWSTR s); 66 | static BOOL _Everything_IsSchemeNameA(LPCSTR s); 67 | static void _Everything_ChangeWindowMessageFilter(HWND hwnd); 68 | static BOOL _Everything_GetResultRequestData(DWORD dwIndex,DWORD dwRequestType,void *data,int size); 69 | static LPCWSTR _Everything_GetResultRequestStringW(DWORD dwIndex,DWORD dwRequestType); 70 | static LPCSTR _Everything_GetResultRequestStringA(DWORD dwIndex,DWORD dwRequestType); 71 | static BOOL _Everything_SendAPIBoolCommand(int command,LPARAM lParam); 72 | static DWORD _Everything_SendAPIDwordCommand(int command,LPARAM lParam); 73 | static LRESULT _Everything_SendCopyData(int command,const void *data,int size); 74 | static LRESULT WINAPI _Everything_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam); 75 | 76 | // internal state 77 | static BOOL _Everything_MatchPath = FALSE; 78 | static BOOL _Everything_MatchCase = FALSE; 79 | static BOOL _Everything_MatchWholeWord = FALSE; 80 | static BOOL _Everything_Regex = FALSE; 81 | static DWORD _Everything_LastError = FALSE; 82 | static DWORD _Everything_Max = EVERYTHING_IPC_ALLRESULTS; 83 | static DWORD _Everything_Offset = 0; 84 | static DWORD _Everything_Sort = EVERYTHING_SORT_NAME_ASCENDING; 85 | static DWORD _Everything_RequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME; 86 | static BOOL _Everything_IsUnicodeQuery = FALSE; 87 | static DWORD _Everything_QueryVersion = 0; 88 | static BOOL _Everything_IsUnicodeSearch = FALSE; 89 | static void *_Everything_Search = NULL; // wchar or char 90 | static EVERYTHING_IPC_LIST2 *_Everything_List2 = NULL; 91 | static void *_Everything_List = NULL; // EVERYTHING_IPC_LISTW or EVERYTHING_IPC_LISTA 92 | static volatile BOOL _Everything_Initialized = FALSE; 93 | static volatile LONG _Everything_InterlockedCount = 0; 94 | static CRITICAL_SECTION _Everything_cs; 95 | static HWND _Everything_ReplyWindow = 0; 96 | static DWORD _Everything_ReplyID = 0; 97 | static BOOL (WINAPI *_Everything_pChangeWindowMessageFilterEx)(HWND hWnd,UINT message,DWORD action,_EVERYTHING_PCHANGEFILTERSTRUCT pChangeFilterStruct) = 0; 98 | static HANDLE _Everything_user32_hdll = NULL; 99 | static BOOL _Everything_GotChangeWindowMessageFilterEx = FALSE; 100 | 101 | static void _Everything_Initialize(void) 102 | { 103 | if (!_Everything_Initialized) 104 | { 105 | if (InterlockedIncrement(&_Everything_InterlockedCount) == 1) 106 | { 107 | // do the initialization.. 108 | InitializeCriticalSection(&_Everything_cs); 109 | 110 | _Everything_Initialized = 1; 111 | } 112 | else 113 | { 114 | // wait for initialization by other thread. 115 | while (!_Everything_Initialized) Sleep(0); 116 | } 117 | } 118 | } 119 | 120 | static void _Everything_Lock(void) 121 | { 122 | _Everything_Initialize(); 123 | 124 | EnterCriticalSection(&_Everything_cs); 125 | } 126 | 127 | static void _Everything_Unlock(void) 128 | { 129 | LeaveCriticalSection(&_Everything_cs); 130 | } 131 | 132 | // avoid other libs 133 | static DWORD _Everything_StringLengthA(LPCSTR start) 134 | { 135 | register LPCSTR s; 136 | 137 | s = start; 138 | 139 | while(*s) 140 | { 141 | s++; 142 | } 143 | 144 | return (DWORD)(s-start); 145 | } 146 | 147 | static DWORD _Everything_StringLengthW(LPCWSTR start) 148 | { 149 | register LPCWSTR s; 150 | 151 | s = start; 152 | 153 | while(*s) 154 | { 155 | s++; 156 | } 157 | 158 | return (DWORD)(s-start); 159 | } 160 | 161 | void EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString) 162 | { 163 | DWORD len; 164 | 165 | _Everything_Lock(); 166 | 167 | if (_Everything_Search) 168 | { 169 | _Everything_Free(_Everything_Search); 170 | } 171 | 172 | len = _Everything_StringLengthW(lpString) + 1; 173 | 174 | _Everything_Search = _Everything_Alloc(len*sizeof(WCHAR)); 175 | if (_Everything_Search) 176 | { 177 | CopyMemory(_Everything_Search,lpString,len*sizeof(WCHAR)); 178 | } 179 | else 180 | { 181 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 182 | } 183 | 184 | _Everything_IsUnicodeSearch = 1; 185 | 186 | _Everything_Unlock(); 187 | } 188 | 189 | void EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString) 190 | { 191 | DWORD size; 192 | 193 | _Everything_Lock(); 194 | 195 | if (_Everything_Search) 196 | { 197 | _Everything_Free(_Everything_Search); 198 | } 199 | 200 | size = _Everything_StringLengthA(lpString) + 1; 201 | 202 | _Everything_Search = _Everything_Alloc(size); 203 | if (_Everything_Search) 204 | { 205 | CopyMemory(_Everything_Search,lpString,size); 206 | } 207 | else 208 | { 209 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 210 | } 211 | 212 | _Everything_IsUnicodeSearch = 0; 213 | 214 | _Everything_Unlock(); 215 | } 216 | 217 | LPCSTR EVERYTHINGAPI Everything_GetSearchA(void) 218 | { 219 | LPCSTR ret; 220 | 221 | _Everything_Lock(); 222 | 223 | if (_Everything_Search) 224 | { 225 | if (_Everything_IsUnicodeSearch) 226 | { 227 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 228 | 229 | ret = NULL; 230 | } 231 | else 232 | { 233 | ret = (LPCSTR)_Everything_Search; 234 | } 235 | } 236 | else 237 | { 238 | ret = ""; 239 | } 240 | 241 | _Everything_Unlock(); 242 | 243 | return ret; 244 | } 245 | 246 | LPCWSTR EVERYTHINGAPI Everything_GetSearchW(void) 247 | { 248 | LPCWSTR ret; 249 | 250 | _Everything_Lock(); 251 | 252 | if (_Everything_Search) 253 | { 254 | if (!_Everything_IsUnicodeSearch) 255 | { 256 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 257 | 258 | ret = NULL; 259 | } 260 | else 261 | { 262 | ret = (LPCWSTR)_Everything_Search; 263 | } 264 | } 265 | else 266 | { 267 | ret = L""; 268 | } 269 | 270 | _Everything_Unlock(); 271 | 272 | return ret; 273 | } 274 | 275 | void EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable) 276 | { 277 | _Everything_Lock(); 278 | 279 | _Everything_MatchPath = bEnable; 280 | 281 | _Everything_Unlock(); 282 | } 283 | 284 | void EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable) 285 | { 286 | _Everything_Lock(); 287 | 288 | _Everything_MatchCase = bEnable; 289 | 290 | _Everything_Unlock(); 291 | } 292 | 293 | void EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable) 294 | { 295 | _Everything_Lock(); 296 | 297 | _Everything_MatchWholeWord = bEnable; 298 | 299 | _Everything_Unlock(); 300 | } 301 | 302 | void EVERYTHINGAPI Everything_SetRegex(BOOL bEnable) 303 | { 304 | _Everything_Lock(); 305 | 306 | _Everything_Regex = bEnable; 307 | 308 | _Everything_Unlock(); 309 | } 310 | 311 | void EVERYTHINGAPI Everything_SetMax(DWORD dwMax) 312 | { 313 | _Everything_Lock(); 314 | 315 | _Everything_Max = dwMax; 316 | 317 | _Everything_Unlock(); 318 | } 319 | 320 | void EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset) 321 | { 322 | _Everything_Lock(); 323 | 324 | _Everything_Offset = dwOffset; 325 | 326 | _Everything_Unlock(); 327 | } 328 | 329 | void EVERYTHINGAPI Everything_SetSort(DWORD dwSort) 330 | { 331 | _Everything_Lock(); 332 | 333 | _Everything_Sort = dwSort; 334 | 335 | _Everything_Unlock(); 336 | } 337 | 338 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRequestFlags(DWORD dwRequestFlags) 339 | { 340 | _Everything_Lock(); 341 | 342 | _Everything_RequestFlags = dwRequestFlags; 343 | 344 | _Everything_Unlock(); 345 | } 346 | 347 | void EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd) 348 | { 349 | _Everything_Lock(); 350 | 351 | _Everything_ReplyWindow = hWnd; 352 | 353 | _Everything_Unlock(); 354 | } 355 | 356 | void EVERYTHINGAPI Everything_SetReplyID(DWORD dwId) 357 | { 358 | _Everything_Lock(); 359 | 360 | _Everything_ReplyID = dwId; 361 | 362 | _Everything_Unlock(); 363 | } 364 | 365 | BOOL EVERYTHINGAPI Everything_GetMatchPath(void) 366 | { 367 | BOOL ret; 368 | 369 | _Everything_Lock(); 370 | 371 | ret = _Everything_MatchPath; 372 | 373 | _Everything_Unlock(); 374 | 375 | return ret; 376 | } 377 | 378 | BOOL EVERYTHINGAPI Everything_GetMatchCase(void) 379 | { 380 | BOOL ret; 381 | 382 | _Everything_Lock(); 383 | 384 | ret = _Everything_MatchCase; 385 | 386 | _Everything_Unlock(); 387 | 388 | return ret; 389 | } 390 | 391 | BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(void) 392 | { 393 | BOOL ret; 394 | 395 | _Everything_Lock(); 396 | 397 | ret = _Everything_MatchWholeWord; 398 | 399 | _Everything_Unlock(); 400 | 401 | return ret; 402 | } 403 | 404 | BOOL EVERYTHINGAPI Everything_GetRegex(void) 405 | { 406 | BOOL ret; 407 | 408 | _Everything_Lock(); 409 | 410 | ret = _Everything_Regex; 411 | 412 | _Everything_Unlock(); 413 | 414 | return ret; 415 | } 416 | 417 | DWORD EVERYTHINGAPI Everything_GetMax(void) 418 | { 419 | DWORD ret; 420 | 421 | _Everything_Lock(); 422 | 423 | ret = _Everything_Max; 424 | 425 | _Everything_Unlock(); 426 | 427 | return ret; 428 | } 429 | 430 | DWORD EVERYTHINGAPI Everything_GetOffset(void) 431 | { 432 | DWORD ret; 433 | 434 | _Everything_Lock(); 435 | 436 | ret = _Everything_Offset; 437 | 438 | _Everything_Unlock(); 439 | 440 | return ret; 441 | } 442 | 443 | DWORD EVERYTHINGAPI Everything_GetSort(void) 444 | { 445 | DWORD ret; 446 | 447 | _Everything_Lock(); 448 | 449 | ret = _Everything_Sort; 450 | 451 | _Everything_Unlock(); 452 | 453 | return ret; 454 | } 455 | 456 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRequestFlags(void) 457 | { 458 | DWORD ret; 459 | 460 | _Everything_Lock(); 461 | 462 | ret = _Everything_RequestFlags; 463 | 464 | _Everything_Unlock(); 465 | 466 | return ret; 467 | } 468 | 469 | HWND EVERYTHINGAPI Everything_GetReplyWindow(void) 470 | { 471 | HWND ret; 472 | 473 | _Everything_Lock(); 474 | 475 | ret = _Everything_ReplyWindow; 476 | 477 | _Everything_Unlock(); 478 | 479 | return ret; 480 | } 481 | 482 | DWORD EVERYTHINGAPI Everything_GetReplyID(void) 483 | { 484 | DWORD ret; 485 | 486 | _Everything_Lock(); 487 | 488 | ret = _Everything_ReplyID; 489 | 490 | _Everything_Unlock(); 491 | 492 | return ret; 493 | } 494 | 495 | // custom window proc 496 | static LRESULT WINAPI _Everything_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) 497 | { 498 | switch(msg) 499 | { 500 | case WM_COPYDATA: 501 | { 502 | COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam; 503 | 504 | switch(cds->dwData) 505 | { 506 | case _EVERYTHING_COPYDATA_QUERYREPLY: 507 | 508 | if (_Everything_QueryVersion == 2) 509 | { 510 | _Everything_FreeLists(); 511 | 512 | _Everything_List2 = _Everything_Alloc(cds->cbData); 513 | 514 | if (_Everything_List2) 515 | { 516 | CopyMemory(_Everything_List2,cds->lpData,cds->cbData); 517 | } 518 | else 519 | { 520 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 521 | } 522 | 523 | PostQuitMessage(0); 524 | } 525 | else 526 | if (_Everything_QueryVersion == 1) 527 | { 528 | _Everything_FreeLists(); 529 | 530 | _Everything_List = _Everything_Alloc(cds->cbData); 531 | 532 | if (_Everything_List) 533 | { 534 | CopyMemory(_Everything_List,cds->lpData,cds->cbData); 535 | } 536 | else 537 | { 538 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 539 | } 540 | 541 | PostQuitMessage(0); 542 | 543 | return TRUE; 544 | } 545 | 546 | break; 547 | } 548 | 549 | break; 550 | } 551 | } 552 | 553 | return DefWindowProc(hwnd,msg,wParam,lParam); 554 | } 555 | 556 | // get the search length 557 | static DWORD _Everything_GetSearchLengthW(void) 558 | { 559 | if (_Everything_Search) 560 | { 561 | if (_Everything_IsUnicodeSearch) 562 | { 563 | return _Everything_StringLengthW((LPCWSTR )_Everything_Search); 564 | } 565 | else 566 | { 567 | return MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,0,0); 568 | } 569 | } 570 | 571 | return 0; 572 | } 573 | 574 | // get the search length 575 | static DWORD _Everything_GetSearchLengthA(void) 576 | { 577 | if (_Everything_Search) 578 | { 579 | if (_Everything_IsUnicodeSearch) 580 | { 581 | return WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,0,0,0,0); 582 | } 583 | else 584 | { 585 | return _Everything_StringLengthA((LPCSTR )_Everything_Search); 586 | } 587 | } 588 | 589 | return 0; 590 | } 591 | 592 | // get the search length 593 | static void _Everything_GetSearchTextW(LPWSTR wbuf) 594 | { 595 | DWORD wlen; 596 | 597 | if (_Everything_Search) 598 | { 599 | wlen = _Everything_GetSearchLengthW(); 600 | 601 | if (_Everything_IsUnicodeSearch) 602 | { 603 | CopyMemory(wbuf,_Everything_Search,(wlen+1) * sizeof(WCHAR)); 604 | 605 | return; 606 | } 607 | else 608 | { 609 | MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,wbuf,wlen+1); 610 | 611 | return; 612 | } 613 | } 614 | 615 | *wbuf = 0; 616 | } 617 | 618 | // get the search length 619 | static void _Everything_GetSearchTextA(LPSTR buf) 620 | { 621 | DWORD len; 622 | 623 | if (_Everything_Search) 624 | { 625 | len = _Everything_GetSearchLengthW(); 626 | 627 | if (_Everything_IsUnicodeSearch) 628 | { 629 | WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,buf,len+1,0,0); 630 | 631 | return; 632 | } 633 | else 634 | { 635 | CopyMemory(buf,_Everything_Search,len+1); 636 | 637 | return; 638 | } 639 | } 640 | 641 | *buf = 0; 642 | } 643 | 644 | static DWORD EVERYTHINGAPI _Everything_query_thread_proc(void *param) 645 | { 646 | HWND everything_hwnd; 647 | 648 | everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 649 | if (everything_hwnd) 650 | { 651 | WNDCLASSEX wcex; 652 | HWND hwnd; 653 | MSG msg; 654 | int ret; 655 | 656 | ZeroMemory(&wcex,sizeof(WNDCLASSEX)); 657 | wcex.cbSize = sizeof(WNDCLASSEX); 658 | 659 | if (!GetClassInfoEx(GetModuleHandle(0),TEXT("EVERYTHING_DLL"),&wcex)) 660 | { 661 | ZeroMemory(&wcex,sizeof(WNDCLASSEX)); 662 | wcex.cbSize = sizeof(WNDCLASSEX); 663 | wcex.hInstance = GetModuleHandle(0); 664 | wcex.lpfnWndProc = _Everything_window_proc; 665 | wcex.lpszClassName = TEXT("EVERYTHING_DLL"); 666 | 667 | if (!RegisterClassEx(&wcex)) 668 | { 669 | _Everything_LastError = EVERYTHING_ERROR_REGISTERCLASSEX; 670 | 671 | return 0; 672 | } 673 | } 674 | 675 | //FIXME: this should be static so we keep file info cached. 676 | 677 | hwnd = CreateWindow( 678 | TEXT("EVERYTHING_DLL"), 679 | TEXT(""), 680 | 0, 681 | 0,0,0,0, 682 | 0,0,GetModuleHandle(0),0); 683 | 684 | if (hwnd) 685 | { 686 | _Everything_ChangeWindowMessageFilter(hwnd); 687 | 688 | _Everything_ReplyWindow = hwnd; 689 | _Everything_ReplyID = _EVERYTHING_COPYDATA_QUERYREPLY; 690 | 691 | if (_Everything_SendIPCQuery()) 692 | { 693 | // message pump 694 | loop: 695 | 696 | WaitMessage(); 697 | 698 | // update windows 699 | while(PeekMessage(&msg,NULL,0,0,0)) 700 | { 701 | ret = (DWORD)GetMessage(&msg,0,0,0); 702 | if (ret == -1) goto exit; 703 | if (!ret) goto exit; 704 | 705 | // let windows handle it. 706 | TranslateMessage(&msg); 707 | DispatchMessage(&msg); 708 | } 709 | 710 | goto loop; 711 | } 712 | 713 | exit: 714 | 715 | // get result from window. 716 | DestroyWindow(hwnd); 717 | } 718 | else 719 | { 720 | _Everything_LastError = EVERYTHING_ERROR_CREATEWINDOW; 721 | } 722 | } 723 | else 724 | { 725 | // the everything window was not found. 726 | // we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and 727 | // wait for Everything to post this message to all top level windows when its up and running. 728 | _Everything_LastError = EVERYTHING_ERROR_IPC; 729 | } 730 | 731 | return 0; 732 | } 733 | 734 | static BOOL EVERYTHINGAPI _Everything_Query(void) 735 | { 736 | HANDLE hthread; 737 | DWORD thread_id; 738 | 739 | // reset the error flag. 740 | _Everything_LastError = 0; 741 | 742 | hthread = CreateThread(0,0,_Everything_query_thread_proc,0,0,&thread_id); 743 | 744 | if (hthread) 745 | { 746 | WaitForSingleObject(hthread,INFINITE); 747 | 748 | CloseHandle(hthread); 749 | } 750 | else 751 | { 752 | _Everything_LastError = EVERYTHING_ERROR_CREATETHREAD; 753 | } 754 | 755 | return (_Everything_LastError == 0)?TRUE:FALSE; 756 | } 757 | 758 | static BOOL _Everything_SendIPCQuery2(HWND everything_hwnd) 759 | { 760 | BOOL ret; 761 | DWORD size; 762 | EVERYTHING_IPC_QUERY2 *query; 763 | 764 | // try version 2. 765 | 766 | if (_Everything_IsUnicodeQuery) 767 | { 768 | // unicode 769 | size = sizeof(EVERYTHING_IPC_QUERY2) + ((_Everything_GetSearchLengthW() + 1) * sizeof(WCHAR)); 770 | } 771 | else 772 | { 773 | // ansi 774 | size = sizeof(EVERYTHING_IPC_QUERY2) + ((_Everything_GetSearchLengthA() + 1) * sizeof(char)); 775 | } 776 | 777 | // alloc 778 | query = _Everything_Alloc(size); 779 | 780 | if (query) 781 | { 782 | COPYDATASTRUCT cds; 783 | 784 | query->max_results = _Everything_Max; 785 | query->offset = _Everything_Offset; 786 | query->reply_copydata_message = _Everything_ReplyID; 787 | query->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); 788 | query->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow; 789 | query->sort_type = (DWORD)_Everything_Sort; 790 | query->request_flags = (DWORD)_Everything_RequestFlags; 791 | 792 | if (_Everything_IsUnicodeQuery) 793 | { 794 | _Everything_GetSearchTextW((LPWSTR)(query + 1)); 795 | } 796 | else 797 | { 798 | _Everything_GetSearchTextA((LPSTR)(query + 1)); 799 | } 800 | 801 | cds.cbData = size; 802 | cds.dwData = _Everything_IsUnicodeQuery ? EVERYTHING_IPC_COPYDATA_QUERY2W : EVERYTHING_IPC_COPYDATA_QUERY2A; 803 | cds.lpData = query; 804 | 805 | if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)_Everything_ReplyWindow,(LPARAM)&cds)) 806 | { 807 | // successful. 808 | ret = TRUE; 809 | } 810 | else 811 | { 812 | // no ipc 813 | _Everything_LastError = EVERYTHING_ERROR_IPC; 814 | 815 | ret = FALSE; 816 | } 817 | 818 | // get result from window. 819 | _Everything_Free(query); 820 | } 821 | else 822 | { 823 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 824 | 825 | ret = FALSE; 826 | } 827 | 828 | return ret; 829 | } 830 | 831 | static BOOL _Everything_ShouldUseVersion2(void) 832 | { 833 | if (_Everything_RequestFlags != (EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME)) 834 | { 835 | return TRUE; 836 | } 837 | 838 | if (_Everything_Sort != EVERYTHING_SORT_NAME_ASCENDING) 839 | { 840 | return TRUE; 841 | } 842 | 843 | // just use version 1 844 | return FALSE; 845 | } 846 | 847 | static BOOL _Everything_SendIPCQuery(void) 848 | { 849 | HWND everything_hwnd; 850 | BOOL ret; 851 | 852 | // find the everything ipc window. 853 | everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 854 | if (everything_hwnd) 855 | { 856 | _Everything_QueryVersion = 2; 857 | 858 | // try version 2 first (if we specified some non-version 1 request flags or sort) 859 | if ((_Everything_ShouldUseVersion2()) && (_Everything_SendIPCQuery2(everything_hwnd))) 860 | { 861 | // sucessful. 862 | ret = TRUE; 863 | } 864 | else 865 | { 866 | DWORD len; 867 | DWORD size; 868 | void *query; 869 | 870 | // try version 1. 871 | 872 | if (_Everything_IsUnicodeQuery) 873 | { 874 | // unicode 875 | len = _Everything_GetSearchLengthW(); 876 | 877 | size = sizeof(EVERYTHING_IPC_QUERYW) - sizeof(WCHAR) + len*sizeof(WCHAR) + sizeof(WCHAR); 878 | } 879 | else 880 | { 881 | // ansi 882 | len = _Everything_GetSearchLengthA(); 883 | 884 | size = sizeof(EVERYTHING_IPC_QUERYA) - sizeof(char) + (len*sizeof(char)) + sizeof(char); 885 | } 886 | 887 | // alloc 888 | query = _Everything_Alloc(size); 889 | 890 | if (query) 891 | { 892 | COPYDATASTRUCT cds; 893 | 894 | if (_Everything_IsUnicodeQuery) 895 | { 896 | ((EVERYTHING_IPC_QUERYW *)query)->max_results = _Everything_Max; 897 | ((EVERYTHING_IPC_QUERYW *)query)->offset = _Everything_Offset; 898 | ((EVERYTHING_IPC_QUERYW *)query)->reply_copydata_message = _Everything_ReplyID; 899 | ((EVERYTHING_IPC_QUERYW *)query)->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); 900 | ((EVERYTHING_IPC_QUERYW *)query)->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow; 901 | 902 | _Everything_GetSearchTextW(((EVERYTHING_IPC_QUERYW *)query)->search_string); 903 | } 904 | else 905 | { 906 | ((EVERYTHING_IPC_QUERYA *)query)->max_results = _Everything_Max; 907 | ((EVERYTHING_IPC_QUERYA *)query)->offset = _Everything_Offset; 908 | ((EVERYTHING_IPC_QUERYA *)query)->reply_copydata_message = _Everything_ReplyID; 909 | ((EVERYTHING_IPC_QUERYA *)query)->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); 910 | ((EVERYTHING_IPC_QUERYA *)query)->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow; 911 | 912 | _Everything_GetSearchTextA(((EVERYTHING_IPC_QUERYA *)query)->search_string); 913 | } 914 | 915 | cds.cbData = size; 916 | cds.dwData = _Everything_IsUnicodeQuery ? EVERYTHING_IPC_COPYDATAQUERYW : EVERYTHING_IPC_COPYDATAQUERYA; 917 | cds.lpData = query; 918 | 919 | _Everything_QueryVersion = 1; 920 | 921 | if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)_Everything_ReplyWindow,(LPARAM)&cds)) 922 | { 923 | // sucessful. 924 | ret = TRUE; 925 | } 926 | else 927 | { 928 | // no ipc 929 | _Everything_LastError = EVERYTHING_ERROR_IPC; 930 | 931 | ret = FALSE; 932 | } 933 | 934 | // get result from window. 935 | _Everything_Free(query); 936 | } 937 | else 938 | { 939 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 940 | 941 | ret = FALSE; 942 | } 943 | } 944 | } 945 | else 946 | { 947 | _Everything_LastError = EVERYTHING_ERROR_IPC; 948 | 949 | ret = FALSE; 950 | } 951 | 952 | return ret; 953 | } 954 | 955 | BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait) 956 | { 957 | BOOL ret; 958 | 959 | _Everything_Lock(); 960 | 961 | _Everything_IsUnicodeQuery = FALSE; 962 | 963 | if (bWait) 964 | { 965 | ret = _Everything_Query(); 966 | } 967 | else 968 | { 969 | ret = _Everything_SendIPCQuery(); 970 | } 971 | 972 | _Everything_Unlock(); 973 | 974 | return ret; 975 | } 976 | 977 | BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait) 978 | { 979 | BOOL ret; 980 | 981 | _Everything_Lock(); 982 | 983 | _Everything_IsUnicodeQuery = TRUE; 984 | 985 | if (bWait) 986 | { 987 | ret = _Everything_Query(); 988 | } 989 | else 990 | { 991 | ret = _Everything_SendIPCQuery(); 992 | } 993 | 994 | _Everything_Unlock(); 995 | 996 | return ret; 997 | } 998 | 999 | static int __cdecl _Everything_CompareA(const void *a,const void *b) 1000 | { 1001 | int i; 1002 | 1003 | i = stricmp(EVERYTHING_IPC_ITEMPATHA(_Everything_List,a),EVERYTHING_IPC_ITEMPATHA(_Everything_List,b)); 1004 | 1005 | if (!i) 1006 | { 1007 | return stricmp(EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,b)); 1008 | } 1009 | else 1010 | if (i > 0) 1011 | { 1012 | return 1; 1013 | } 1014 | else 1015 | { 1016 | return -1; 1017 | } 1018 | } 1019 | 1020 | static int __cdecl _Everything_CompareW(const void *a,const void *b) 1021 | { 1022 | int i; 1023 | 1024 | i = wcsicmp(EVERYTHING_IPC_ITEMPATHW(_Everything_List,a),EVERYTHING_IPC_ITEMPATHW(_Everything_List,b)); 1025 | 1026 | if (!i) 1027 | { 1028 | return wcsicmp(EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,b)); 1029 | } 1030 | else 1031 | if (i > 0) 1032 | { 1033 | return 1; 1034 | } 1035 | else 1036 | { 1037 | return -1; 1038 | } 1039 | } 1040 | 1041 | void EVERYTHINGAPI Everything_SortResultsByPath(void) 1042 | { 1043 | _Everything_Lock(); 1044 | 1045 | if (_Everything_List) 1046 | { 1047 | if (_Everything_IsUnicodeQuery) 1048 | { 1049 | qsort(((EVERYTHING_IPC_LISTW *)_Everything_List)->items,((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMW),_Everything_CompareW); 1050 | } 1051 | else 1052 | { 1053 | qsort(((EVERYTHING_IPC_LISTA *)_Everything_List)->items,((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMA),_Everything_CompareA); 1054 | } 1055 | } 1056 | else 1057 | { 1058 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1059 | } 1060 | 1061 | //FIXME://TODO: sort list2 1062 | 1063 | _Everything_Unlock(); 1064 | } 1065 | 1066 | DWORD EVERYTHINGAPI Everything_GetLastError(void) 1067 | { 1068 | DWORD ret; 1069 | 1070 | _Everything_Lock(); 1071 | 1072 | ret = _Everything_LastError; 1073 | 1074 | _Everything_Unlock(); 1075 | 1076 | return ret; 1077 | } 1078 | 1079 | DWORD EVERYTHINGAPI Everything_GetNumFileResults(void) 1080 | { 1081 | DWORD ret; 1082 | 1083 | _Everything_Lock(); 1084 | 1085 | if (_Everything_List) 1086 | { 1087 | if (_Everything_IsUnicodeQuery) 1088 | { 1089 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfiles; 1090 | } 1091 | else 1092 | { 1093 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfiles; 1094 | } 1095 | } 1096 | else 1097 | { 1098 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1099 | 1100 | ret = 0; 1101 | } 1102 | 1103 | _Everything_Unlock(); 1104 | 1105 | return ret; 1106 | } 1107 | 1108 | DWORD EVERYTHINGAPI Everything_GetNumFolderResults(void) 1109 | { 1110 | DWORD ret; 1111 | 1112 | _Everything_Lock(); 1113 | 1114 | if (_Everything_List) 1115 | { 1116 | if (_Everything_IsUnicodeQuery) 1117 | { 1118 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfolders; 1119 | } 1120 | else 1121 | { 1122 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfolders; 1123 | } 1124 | } 1125 | else 1126 | { 1127 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1128 | 1129 | ret = 0; 1130 | } 1131 | 1132 | _Everything_Unlock(); 1133 | 1134 | return ret; 1135 | } 1136 | 1137 | DWORD EVERYTHINGAPI Everything_GetNumResults(void) 1138 | { 1139 | DWORD ret; 1140 | 1141 | _Everything_Lock(); 1142 | 1143 | if (_Everything_List) 1144 | { 1145 | if (_Everything_IsUnicodeQuery) 1146 | { 1147 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems; 1148 | } 1149 | else 1150 | { 1151 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems; 1152 | } 1153 | } 1154 | else 1155 | if (_Everything_List2) 1156 | { 1157 | ret = _Everything_List2->numitems; 1158 | } 1159 | else 1160 | { 1161 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1162 | 1163 | ret = 0; 1164 | } 1165 | 1166 | _Everything_Unlock(); 1167 | 1168 | return ret; 1169 | } 1170 | 1171 | DWORD EVERYTHINGAPI Everything_GetTotFileResults(void) 1172 | { 1173 | DWORD ret; 1174 | 1175 | _Everything_Lock(); 1176 | 1177 | if (_Everything_List) 1178 | { 1179 | if (_Everything_IsUnicodeQuery) 1180 | { 1181 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfiles; 1182 | } 1183 | else 1184 | { 1185 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfiles; 1186 | } 1187 | } 1188 | else 1189 | { 1190 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1191 | 1192 | ret = 0; 1193 | } 1194 | 1195 | _Everything_Unlock(); 1196 | 1197 | return ret; 1198 | } 1199 | 1200 | DWORD EVERYTHINGAPI Everything_GetTotFolderResults(void) 1201 | { 1202 | DWORD ret; 1203 | 1204 | _Everything_Lock(); 1205 | 1206 | if (_Everything_List) 1207 | { 1208 | if (_Everything_IsUnicodeQuery) 1209 | { 1210 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfolders; 1211 | } 1212 | else 1213 | { 1214 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfolders; 1215 | } 1216 | } 1217 | else 1218 | { 1219 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1220 | 1221 | ret = 0; 1222 | } 1223 | 1224 | _Everything_Unlock(); 1225 | 1226 | return ret; 1227 | } 1228 | 1229 | DWORD EVERYTHINGAPI Everything_GetTotResults(void) 1230 | { 1231 | DWORD ret; 1232 | 1233 | _Everything_Lock(); 1234 | 1235 | if (_Everything_List) 1236 | { 1237 | if (_Everything_IsUnicodeQuery) 1238 | { 1239 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totitems; 1240 | } 1241 | else 1242 | { 1243 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totitems; 1244 | } 1245 | } 1246 | else 1247 | if (_Everything_List2) 1248 | { 1249 | ret = _Everything_List2->totitems; 1250 | } 1251 | else 1252 | { 1253 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1254 | 1255 | ret = 0; 1256 | } 1257 | 1258 | _Everything_Unlock(); 1259 | 1260 | return ret; 1261 | } 1262 | 1263 | BOOL EVERYTHINGAPI Everything_IsVolumeResult(DWORD dwIndex) 1264 | { 1265 | BOOL ret; 1266 | 1267 | _Everything_Lock(); 1268 | 1269 | if (_Everything_List) 1270 | { 1271 | if (_Everything_IsValidResultIndex(dwIndex)) 1272 | { 1273 | if (_Everything_IsUnicodeQuery) 1274 | { 1275 | ret = (((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE; 1276 | } 1277 | else 1278 | { 1279 | ret = (((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE; 1280 | } 1281 | } 1282 | else 1283 | { 1284 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1285 | 1286 | ret = FALSE; 1287 | } 1288 | } 1289 | else 1290 | if (_Everything_List2) 1291 | { 1292 | if (_Everything_IsValidResultIndex(dwIndex)) 1293 | { 1294 | ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE; 1295 | } 1296 | else 1297 | { 1298 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1299 | 1300 | ret = FALSE; 1301 | } 1302 | } 1303 | else 1304 | { 1305 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1306 | 1307 | ret = FALSE; 1308 | } 1309 | 1310 | _Everything_Unlock(); 1311 | 1312 | return ret; 1313 | } 1314 | 1315 | BOOL EVERYTHINGAPI Everything_IsFolderResult(DWORD dwIndex) 1316 | { 1317 | BOOL ret; 1318 | 1319 | _Everything_Lock(); 1320 | 1321 | if (_Everything_List) 1322 | { 1323 | if (_Everything_IsValidResultIndex(dwIndex)) 1324 | { 1325 | if (_Everything_IsUnicodeQuery) 1326 | { 1327 | ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER) ? TRUE : FALSE; 1328 | } 1329 | else 1330 | { 1331 | ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER) ? TRUE : FALSE; 1332 | } 1333 | } 1334 | else 1335 | { 1336 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1337 | 1338 | ret = FALSE; 1339 | } 1340 | } 1341 | else 1342 | if (_Everything_List2) 1343 | { 1344 | if (_Everything_IsValidResultIndex(dwIndex)) 1345 | { 1346 | ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? TRUE : FALSE; 1347 | } 1348 | else 1349 | { 1350 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1351 | 1352 | ret = FALSE; 1353 | } 1354 | } 1355 | else 1356 | { 1357 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1358 | 1359 | ret = FALSE; 1360 | } 1361 | 1362 | _Everything_Unlock(); 1363 | 1364 | return ret; 1365 | } 1366 | 1367 | BOOL EVERYTHINGAPI Everything_IsFileResult(DWORD dwIndex) 1368 | { 1369 | BOOL ret; 1370 | 1371 | _Everything_Lock(); 1372 | 1373 | if (_Everything_List) 1374 | { 1375 | if (_Everything_IsValidResultIndex(dwIndex)) 1376 | { 1377 | if (_Everything_IsUnicodeQuery) 1378 | { 1379 | ret = (((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE; 1380 | } 1381 | else 1382 | { 1383 | ret = (((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE; 1384 | } 1385 | } 1386 | else 1387 | { 1388 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1389 | 1390 | ret = FALSE; 1391 | } 1392 | } 1393 | else 1394 | if (_Everything_List2) 1395 | { 1396 | if (_Everything_IsValidResultIndex(dwIndex)) 1397 | { 1398 | ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE; 1399 | } 1400 | else 1401 | { 1402 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1403 | 1404 | ret = FALSE; 1405 | } 1406 | } 1407 | else 1408 | { 1409 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1410 | 1411 | ret = FALSE; 1412 | } 1413 | 1414 | _Everything_Unlock(); 1415 | 1416 | return ret; 1417 | } 1418 | 1419 | LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(DWORD dwIndex) 1420 | { 1421 | LPCWSTR ret; 1422 | 1423 | _Everything_Lock(); 1424 | 1425 | if ((_Everything_List) && (_Everything_IsUnicodeQuery)) 1426 | { 1427 | if (_Everything_IsValidResultIndex(dwIndex)) 1428 | { 1429 | ret = EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]); 1430 | } 1431 | else 1432 | { 1433 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1434 | 1435 | ret = NULL; 1436 | } 1437 | } 1438 | else 1439 | if ((_Everything_List2) && (_Everything_IsUnicodeQuery)) 1440 | { 1441 | if (_Everything_IsValidResultIndex(dwIndex)) 1442 | { 1443 | ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME); 1444 | 1445 | if (ret) 1446 | { 1447 | // skip length in characters. 1448 | ret = (LPCWSTR)(((char *)ret) + sizeof(DWORD)); 1449 | } 1450 | else 1451 | { 1452 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1453 | } 1454 | } 1455 | else 1456 | { 1457 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1458 | 1459 | ret = NULL; 1460 | } 1461 | } 1462 | else 1463 | { 1464 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1465 | 1466 | ret = NULL; 1467 | } 1468 | 1469 | _Everything_Unlock(); 1470 | 1471 | return ret; 1472 | } 1473 | 1474 | LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(DWORD dwIndex) 1475 | { 1476 | LPCSTR ret; 1477 | 1478 | _Everything_Lock(); 1479 | 1480 | if ((_Everything_List) && (!_Everything_IsUnicodeQuery)) 1481 | { 1482 | if (_Everything_IsValidResultIndex(dwIndex)) 1483 | { 1484 | ret = EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]); 1485 | } 1486 | else 1487 | { 1488 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1489 | 1490 | ret = NULL; 1491 | } 1492 | } 1493 | else 1494 | if ((_Everything_List2) && (!_Everything_IsUnicodeQuery)) 1495 | { 1496 | if (_Everything_IsValidResultIndex(dwIndex)) 1497 | { 1498 | ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME); 1499 | 1500 | if (ret) 1501 | { 1502 | // skip length in characters. 1503 | ret = (LPCSTR)(((char *)ret) + sizeof(DWORD)); 1504 | } 1505 | else 1506 | { 1507 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1508 | } 1509 | } 1510 | else 1511 | { 1512 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1513 | 1514 | ret = NULL; 1515 | } 1516 | } 1517 | else 1518 | { 1519 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1520 | 1521 | ret = NULL; 1522 | } 1523 | 1524 | _Everything_Unlock(); 1525 | 1526 | return ret; 1527 | } 1528 | 1529 | LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD dwIndex) 1530 | { 1531 | LPCWSTR ret; 1532 | 1533 | _Everything_Lock(); 1534 | 1535 | if ((_Everything_List) && (_Everything_IsUnicodeQuery)) 1536 | { 1537 | if (_Everything_IsValidResultIndex(dwIndex)) 1538 | { 1539 | ret = EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]); 1540 | } 1541 | else 1542 | { 1543 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1544 | 1545 | ret = NULL; 1546 | } 1547 | } 1548 | else 1549 | if ((_Everything_List2) && (_Everything_IsUnicodeQuery)) 1550 | { 1551 | if (_Everything_IsValidResultIndex(dwIndex)) 1552 | { 1553 | ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH); 1554 | 1555 | if (ret) 1556 | { 1557 | // skip length in characters. 1558 | ret = (LPCWSTR)(((char *)ret) + sizeof(DWORD)); 1559 | } 1560 | else 1561 | { 1562 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1563 | } 1564 | } 1565 | else 1566 | { 1567 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1568 | 1569 | ret = NULL; 1570 | } 1571 | } 1572 | else 1573 | { 1574 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1575 | 1576 | ret = NULL; 1577 | } 1578 | 1579 | _Everything_Unlock(); 1580 | 1581 | return ret; 1582 | } 1583 | 1584 | LPCSTR EVERYTHINGAPI Everything_GetResultPathA(DWORD dwIndex) 1585 | { 1586 | LPCSTR ret; 1587 | 1588 | _Everything_Lock(); 1589 | 1590 | if (_Everything_List) 1591 | { 1592 | if (_Everything_IsValidResultIndex(dwIndex)) 1593 | { 1594 | ret = EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]); 1595 | } 1596 | else 1597 | { 1598 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1599 | 1600 | ret = NULL; 1601 | } 1602 | } 1603 | else 1604 | if ((_Everything_List2) && (!_Everything_IsUnicodeQuery)) 1605 | { 1606 | if (_Everything_IsValidResultIndex(dwIndex)) 1607 | { 1608 | ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH); 1609 | 1610 | if (ret) 1611 | { 1612 | // skip length in characters. 1613 | ret = (LPCSTR)(((char *)ret) + sizeof(DWORD)); 1614 | } 1615 | else 1616 | { 1617 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1618 | } 1619 | } 1620 | else 1621 | { 1622 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1623 | 1624 | ret = NULL; 1625 | } 1626 | } 1627 | else 1628 | { 1629 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1630 | 1631 | ret = NULL; 1632 | } 1633 | 1634 | _Everything_Unlock(); 1635 | 1636 | return ret; 1637 | } 1638 | 1639 | // max is in chars 1640 | static DWORD _Everything_CopyW(LPWSTR buf,DWORD bufmax,DWORD catlen,LPCWSTR s) 1641 | { 1642 | DWORD wlen; 1643 | 1644 | if (buf) 1645 | { 1646 | buf += catlen; 1647 | bufmax -= catlen; 1648 | } 1649 | 1650 | wlen = _Everything_StringLengthW(s); 1651 | if (!wlen) 1652 | { 1653 | if (buf) 1654 | { 1655 | buf[wlen] = 0; 1656 | } 1657 | 1658 | return catlen; 1659 | } 1660 | 1661 | // terminate 1662 | if (wlen > bufmax-1) wlen = bufmax-1; 1663 | 1664 | if (buf) 1665 | { 1666 | CopyMemory(buf,s,wlen*sizeof(WCHAR)); 1667 | 1668 | buf[wlen] = 0; 1669 | } 1670 | 1671 | return wlen + catlen; 1672 | } 1673 | 1674 | static DWORD _Everything_CopyA(LPSTR buf,DWORD max,DWORD catlen,LPCSTR s) 1675 | { 1676 | DWORD len; 1677 | 1678 | if (buf) 1679 | { 1680 | buf += catlen; 1681 | max -= catlen; 1682 | } 1683 | 1684 | len = _Everything_StringLengthA(s); 1685 | if (!len) 1686 | { 1687 | if (buf) 1688 | { 1689 | buf[len] = 0; 1690 | } 1691 | 1692 | return catlen; 1693 | } 1694 | 1695 | // terminate 1696 | if (len > max-1) len = max-1; 1697 | 1698 | if (buf) 1699 | { 1700 | CopyMemory(buf,s,len*sizeof(char)); 1701 | 1702 | buf[len] = 0; 1703 | } 1704 | 1705 | return len + catlen; 1706 | 1707 | } 1708 | 1709 | // max is in chars 1710 | static DWORD _Everything_CopyWFromA(LPWSTR buf,DWORD bufmax,DWORD catlen,LPCSTR s) 1711 | { 1712 | DWORD wlen; 1713 | 1714 | if (buf) 1715 | { 1716 | buf += catlen; 1717 | bufmax -= catlen; 1718 | } 1719 | 1720 | wlen = MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),0,0); 1721 | if (!wlen) 1722 | { 1723 | if (buf) 1724 | { 1725 | buf[wlen] = 0; 1726 | } 1727 | 1728 | return catlen; 1729 | } 1730 | 1731 | // terminate 1732 | if (wlen > bufmax-1) wlen = bufmax-1; 1733 | 1734 | if (buf) 1735 | { 1736 | MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),buf,wlen); 1737 | 1738 | buf[wlen] = 0; 1739 | } 1740 | 1741 | return wlen + catlen; 1742 | } 1743 | 1744 | static DWORD _Everything_CopyAFromW(LPSTR buf,DWORD max,DWORD catlen,LPCWSTR s) 1745 | { 1746 | DWORD len; 1747 | 1748 | if (buf) 1749 | { 1750 | buf += catlen; 1751 | max -= catlen; 1752 | } 1753 | 1754 | len = WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),0,0,0,0); 1755 | if (!len) 1756 | { 1757 | if (buf) 1758 | { 1759 | buf[len] = 0; 1760 | } 1761 | 1762 | return catlen; 1763 | } 1764 | 1765 | // terminate 1766 | if (len > max-1) len = max-1; 1767 | 1768 | if (buf) 1769 | { 1770 | WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),buf,len,0,0); 1771 | 1772 | buf[len] = 0; 1773 | } 1774 | 1775 | return len + catlen; 1776 | 1777 | } 1778 | 1779 | DWORD EVERYTHINGAPI Everything_GetResultFullPathNameW(DWORD dwIndex,LPWSTR wbuf,DWORD wbuf_size_in_wchars) 1780 | { 1781 | DWORD len; 1782 | 1783 | _Everything_Lock(); 1784 | 1785 | if (_Everything_List) 1786 | { 1787 | if (_Everything_IsValidResultIndex(dwIndex)) 1788 | { 1789 | if (_Everything_IsUnicodeQuery) 1790 | { 1791 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex])); 1792 | } 1793 | else 1794 | { 1795 | len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex])); 1796 | } 1797 | 1798 | if (len) 1799 | { 1800 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameW(wbuf) ? L"/" : L"\\"); 1801 | } 1802 | 1803 | if (_Everything_IsUnicodeQuery) 1804 | { 1805 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex])); 1806 | } 1807 | else 1808 | { 1809 | len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex])); 1810 | } 1811 | } 1812 | else 1813 | { 1814 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1815 | 1816 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); 1817 | } 1818 | } 1819 | else 1820 | if (_Everything_List2) 1821 | { 1822 | if (_Everything_IsValidResultIndex(dwIndex)) 1823 | { 1824 | const void *full_path_and_name; 1825 | 1826 | full_path_and_name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME); 1827 | 1828 | if (full_path_and_name) 1829 | { 1830 | // skip number of characters. 1831 | full_path_and_name = (void *)(((char *)full_path_and_name) + sizeof(DWORD)); 1832 | 1833 | // we got the full path and name already. 1834 | if (_Everything_IsUnicodeQuery) 1835 | { 1836 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,full_path_and_name); 1837 | } 1838 | else 1839 | { 1840 | len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,full_path_and_name); 1841 | } 1842 | } 1843 | else 1844 | { 1845 | const void *path; 1846 | 1847 | path = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH); 1848 | 1849 | if (path) 1850 | { 1851 | const void *name; 1852 | 1853 | // skip number of characters. 1854 | path = (void *)(((char *)path) + sizeof(DWORD)); 1855 | 1856 | name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME); 1857 | 1858 | if (name) 1859 | { 1860 | // skip number of characters. 1861 | name = (void *)(((char *)name) + sizeof(DWORD)); 1862 | 1863 | if (_Everything_IsUnicodeQuery) 1864 | { 1865 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,path); 1866 | } 1867 | else 1868 | { 1869 | len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,path); 1870 | } 1871 | 1872 | if (len) 1873 | { 1874 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameW(wbuf) ? L"/" : L"\\"); 1875 | } 1876 | 1877 | if (_Everything_IsUnicodeQuery) 1878 | { 1879 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,name); 1880 | } 1881 | else 1882 | { 1883 | len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,name); 1884 | } 1885 | } 1886 | else 1887 | { 1888 | // name data not available. 1889 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1890 | 1891 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); 1892 | } 1893 | } 1894 | else 1895 | { 1896 | // path data not available. 1897 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 1898 | 1899 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); 1900 | } 1901 | } 1902 | } 1903 | else 1904 | { 1905 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1906 | 1907 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); 1908 | } 1909 | } 1910 | else 1911 | { 1912 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 1913 | 1914 | len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); 1915 | } 1916 | 1917 | _Everything_Unlock(); 1918 | 1919 | return len; 1920 | } 1921 | 1922 | DWORD EVERYTHINGAPI Everything_GetResultFullPathNameA(DWORD dwIndex,LPSTR buf,DWORD bufsize) 1923 | { 1924 | DWORD len; 1925 | 1926 | _Everything_Lock(); 1927 | 1928 | if (_Everything_List) 1929 | { 1930 | if (_Everything_IsValidResultIndex(dwIndex)) 1931 | { 1932 | if (_Everything_IsUnicodeQuery) 1933 | { 1934 | len = _Everything_CopyAFromW(buf,bufsize,0,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex])); 1935 | } 1936 | else 1937 | { 1938 | len = _Everything_CopyA(buf,bufsize,0,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex])); 1939 | } 1940 | 1941 | if (len) 1942 | { 1943 | len = _Everything_CopyA(buf,bufsize,len,_Everything_IsSchemeNameA(buf) ? "/" : "\\"); 1944 | } 1945 | 1946 | if (_Everything_IsUnicodeQuery) 1947 | { 1948 | len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex])); 1949 | } 1950 | else 1951 | { 1952 | len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex])); 1953 | } 1954 | } 1955 | else 1956 | { 1957 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 1958 | 1959 | len = _Everything_CopyA(buf,bufsize,0,""); 1960 | } 1961 | } 1962 | else 1963 | if (_Everything_List2) 1964 | { 1965 | if (_Everything_IsValidResultIndex(dwIndex)) 1966 | { 1967 | const void *full_path_and_name; 1968 | 1969 | full_path_and_name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME); 1970 | 1971 | if (full_path_and_name) 1972 | { 1973 | // skip number of characters. 1974 | full_path_and_name = (void *)(((char *)full_path_and_name) + sizeof(DWORD)); 1975 | 1976 | // we got the full path and name already. 1977 | if (_Everything_IsUnicodeQuery) 1978 | { 1979 | len = _Everything_CopyAFromW(buf,bufsize,0,full_path_and_name); 1980 | } 1981 | else 1982 | { 1983 | len = _Everything_CopyA(buf,bufsize,0,full_path_and_name); 1984 | } 1985 | } 1986 | else 1987 | { 1988 | const void *path; 1989 | 1990 | path = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH); 1991 | 1992 | if (path) 1993 | { 1994 | const void *name; 1995 | 1996 | // skip number of characters. 1997 | path = (void *)(((char *)path) + sizeof(DWORD)); 1998 | 1999 | name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME); 2000 | 2001 | if (name) 2002 | { 2003 | // skip number of characters. 2004 | name = (void *)(((char *)name) + sizeof(DWORD)); 2005 | 2006 | if (_Everything_IsUnicodeQuery) 2007 | { 2008 | len = _Everything_CopyAFromW(buf,bufsize,0,path); 2009 | } 2010 | else 2011 | { 2012 | len = _Everything_CopyA(buf,bufsize,0,path); 2013 | } 2014 | 2015 | if (len) 2016 | { 2017 | len = _Everything_CopyA(buf,bufsize,len,_Everything_IsSchemeNameA(buf) ? "/" : "\\"); 2018 | } 2019 | 2020 | if (_Everything_IsUnicodeQuery) 2021 | { 2022 | len = _Everything_CopyAFromW(buf,bufsize,len,name); 2023 | } 2024 | else 2025 | { 2026 | len = _Everything_CopyA(buf,bufsize,len,name); 2027 | } 2028 | } 2029 | else 2030 | { 2031 | // name data not available. 2032 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 2033 | 2034 | len = _Everything_CopyA(buf,bufsize,0,""); 2035 | } 2036 | } 2037 | else 2038 | { 2039 | // path data not available. 2040 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 2041 | 2042 | len = _Everything_CopyA(buf,bufsize,0,""); 2043 | } 2044 | } 2045 | } 2046 | else 2047 | { 2048 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 2049 | 2050 | len = _Everything_CopyA(buf,bufsize,0,""); 2051 | } 2052 | } 2053 | else 2054 | { 2055 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 2056 | 2057 | len = _Everything_CopyA(buf,bufsize,0,""); 2058 | } 2059 | 2060 | _Everything_Unlock(); 2061 | 2062 | return len; 2063 | } 2064 | 2065 | BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD dwId) 2066 | { 2067 | if (message == WM_COPYDATA) 2068 | { 2069 | COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam; 2070 | 2071 | if (cds) 2072 | { 2073 | if ((cds->dwData == _Everything_ReplyID) && (cds->dwData == dwId)) 2074 | { 2075 | if (_Everything_QueryVersion == 2) 2076 | { 2077 | _Everything_FreeLists(); 2078 | 2079 | _Everything_List2 = _Everything_Alloc(cds->cbData); 2080 | 2081 | if (_Everything_List2) 2082 | { 2083 | _Everything_LastError = 0; 2084 | 2085 | CopyMemory(_Everything_List2,cds->lpData,cds->cbData); 2086 | } 2087 | else 2088 | { 2089 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 2090 | } 2091 | 2092 | return TRUE; 2093 | } 2094 | else 2095 | if (_Everything_QueryVersion == 1) 2096 | { 2097 | if (_Everything_IsUnicodeQuery) 2098 | { 2099 | _Everything_FreeLists(); 2100 | 2101 | _Everything_List = _Everything_Alloc(cds->cbData); 2102 | 2103 | if (_Everything_List) 2104 | { 2105 | _Everything_LastError = 0; 2106 | 2107 | CopyMemory(_Everything_List,cds->lpData,cds->cbData); 2108 | } 2109 | else 2110 | { 2111 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 2112 | } 2113 | 2114 | return TRUE; 2115 | } 2116 | else 2117 | { 2118 | _Everything_FreeLists(); 2119 | 2120 | _Everything_List = _Everything_Alloc(cds->cbData); 2121 | 2122 | if (_Everything_List) 2123 | { 2124 | _Everything_LastError = 0; 2125 | 2126 | CopyMemory(_Everything_List,cds->lpData,cds->cbData); 2127 | } 2128 | else 2129 | { 2130 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 2131 | } 2132 | 2133 | return TRUE; 2134 | } 2135 | } 2136 | } 2137 | } 2138 | } 2139 | 2140 | return FALSE; 2141 | } 2142 | 2143 | void EVERYTHINGAPI Everything_Reset(void) 2144 | { 2145 | _Everything_Lock(); 2146 | 2147 | if (_Everything_Search) 2148 | { 2149 | _Everything_Free(_Everything_Search); 2150 | 2151 | _Everything_Search = 0; 2152 | } 2153 | 2154 | _Everything_FreeLists(); 2155 | 2156 | // reset state 2157 | _Everything_MatchPath = FALSE; 2158 | _Everything_MatchCase = FALSE; 2159 | _Everything_MatchWholeWord = FALSE; 2160 | _Everything_Regex = FALSE; 2161 | _Everything_LastError = FALSE; 2162 | _Everything_Max = EVERYTHING_IPC_ALLRESULTS; 2163 | _Everything_Offset = 0; 2164 | _Everything_Sort = EVERYTHING_SORT_NAME_ASCENDING; 2165 | _Everything_RequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME; 2166 | _Everything_IsUnicodeQuery = FALSE; 2167 | _Everything_IsUnicodeSearch = FALSE; 2168 | 2169 | _Everything_Unlock(); 2170 | } 2171 | 2172 | void EVERYTHINGAPI Everything_CleanUp(void) 2173 | { 2174 | Everything_Reset(); 2175 | DeleteCriticalSection(&_Everything_cs); 2176 | _Everything_Initialized = 0; 2177 | } 2178 | 2179 | static void *_Everything_Alloc(DWORD size) 2180 | { 2181 | return HeapAlloc(GetProcessHeap(),0,size); 2182 | } 2183 | 2184 | static void _Everything_Free(void *ptr) 2185 | { 2186 | HeapFree(GetProcessHeap(),0,ptr); 2187 | } 2188 | 2189 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListSort(void) 2190 | { 2191 | DWORD dwSort; 2192 | 2193 | _Everything_Lock(); 2194 | 2195 | dwSort = EVERYTHING_SORT_NAME_ASCENDING; 2196 | 2197 | if (_Everything_List2) 2198 | { 2199 | dwSort = _Everything_List2->sort_type; 2200 | } 2201 | 2202 | _Everything_Unlock(); 2203 | 2204 | return dwSort; 2205 | } 2206 | 2207 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListRequestFlags(void) 2208 | { 2209 | DWORD dwRequestFlags; 2210 | 2211 | _Everything_Lock(); 2212 | 2213 | dwRequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME; 2214 | 2215 | if (_Everything_List2) 2216 | { 2217 | dwRequestFlags = _Everything_List2->request_flags; 2218 | } 2219 | 2220 | _Everything_Unlock(); 2221 | 2222 | return dwRequestFlags; 2223 | } 2224 | 2225 | static void _Everything_FreeLists(void) 2226 | { 2227 | if (_Everything_List) 2228 | { 2229 | _Everything_Free(_Everything_List); 2230 | 2231 | _Everything_List = 0; 2232 | } 2233 | 2234 | if (_Everything_List2) 2235 | { 2236 | _Everything_Free(_Everything_List2); 2237 | 2238 | _Everything_List2 = 0; 2239 | } 2240 | } 2241 | 2242 | static BOOL _Everything_IsValidResultIndex(DWORD dwIndex) 2243 | { 2244 | if (dwIndex < 0) 2245 | { 2246 | return FALSE; 2247 | } 2248 | 2249 | if (dwIndex >= Everything_GetNumResults()) 2250 | { 2251 | return FALSE; 2252 | } 2253 | 2254 | return TRUE; 2255 | } 2256 | 2257 | // assumes _Everything_List2 and dwIndex are valid. 2258 | static void *_Everything_GetRequestData(DWORD dwIndex,DWORD dwRequestType) 2259 | { 2260 | char *p; 2261 | EVERYTHING_IPC_ITEM2 *items; 2262 | 2263 | items = (EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1); 2264 | 2265 | p = ((char *)_Everything_List2) + items[dwIndex].data_offset; 2266 | 2267 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FILE_NAME) 2268 | { 2269 | DWORD len; 2270 | 2271 | if (dwRequestType == EVERYTHING_REQUEST_FILE_NAME) 2272 | { 2273 | return p; 2274 | } 2275 | 2276 | len = *(DWORD *)p; 2277 | p += sizeof(DWORD); 2278 | 2279 | if (_Everything_IsUnicodeQuery) 2280 | { 2281 | p += (len + 1) * sizeof(WCHAR); 2282 | } 2283 | else 2284 | { 2285 | p += (len + 1) * sizeof(CHAR); 2286 | } 2287 | } 2288 | 2289 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_PATH) 2290 | { 2291 | DWORD len; 2292 | 2293 | if (dwRequestType == EVERYTHING_REQUEST_PATH) 2294 | { 2295 | return p; 2296 | } 2297 | 2298 | len = *(DWORD *)p; 2299 | p += sizeof(DWORD); 2300 | 2301 | if (_Everything_IsUnicodeQuery) 2302 | { 2303 | p += (len + 1) * sizeof(WCHAR); 2304 | } 2305 | else 2306 | { 2307 | p += (len + 1) * sizeof(CHAR); 2308 | } 2309 | } 2310 | 2311 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME) 2312 | { 2313 | DWORD len; 2314 | 2315 | if (dwRequestType == EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME) 2316 | { 2317 | return p; 2318 | } 2319 | 2320 | len = *(DWORD *)p; 2321 | p += sizeof(DWORD); 2322 | 2323 | if (_Everything_IsUnicodeQuery) 2324 | { 2325 | p += (len + 1) * sizeof(WCHAR); 2326 | } 2327 | else 2328 | { 2329 | p += (len + 1) * sizeof(CHAR); 2330 | } 2331 | } 2332 | 2333 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_EXTENSION) 2334 | { 2335 | DWORD len; 2336 | 2337 | if (dwRequestType == EVERYTHING_REQUEST_EXTENSION) 2338 | { 2339 | return p; 2340 | } 2341 | 2342 | len = *(DWORD *)p; 2343 | p += sizeof(DWORD); 2344 | 2345 | if (_Everything_IsUnicodeQuery) 2346 | { 2347 | p += (len + 1) * sizeof(WCHAR); 2348 | } 2349 | else 2350 | { 2351 | p += (len + 1) * sizeof(CHAR); 2352 | } 2353 | } 2354 | 2355 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_SIZE) 2356 | { 2357 | if (dwRequestType == EVERYTHING_REQUEST_SIZE) 2358 | { 2359 | return p; 2360 | } 2361 | 2362 | p += sizeof(LARGE_INTEGER); 2363 | } 2364 | 2365 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_CREATED) 2366 | { 2367 | if (dwRequestType == EVERYTHING_REQUEST_DATE_CREATED) 2368 | { 2369 | return p; 2370 | } 2371 | 2372 | p += sizeof(FILETIME); 2373 | } 2374 | 2375 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_MODIFIED) 2376 | { 2377 | if (dwRequestType == EVERYTHING_REQUEST_DATE_MODIFIED) 2378 | { 2379 | return p; 2380 | } 2381 | 2382 | p += sizeof(FILETIME); 2383 | } 2384 | 2385 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_ACCESSED) 2386 | { 2387 | if (dwRequestType == EVERYTHING_REQUEST_DATE_ACCESSED) 2388 | { 2389 | return p; 2390 | } 2391 | 2392 | p += sizeof(FILETIME); 2393 | } 2394 | 2395 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_ATTRIBUTES) 2396 | { 2397 | if (dwRequestType == EVERYTHING_REQUEST_ATTRIBUTES) 2398 | { 2399 | return p; 2400 | } 2401 | 2402 | p += sizeof(DWORD); 2403 | } 2404 | 2405 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FILE_LIST_FILE_NAME) 2406 | { 2407 | DWORD len; 2408 | 2409 | if (dwRequestType == EVERYTHING_REQUEST_FILE_LIST_FILE_NAME) 2410 | { 2411 | return p; 2412 | } 2413 | 2414 | len = *(DWORD *)p; 2415 | p += sizeof(DWORD); 2416 | 2417 | if (_Everything_IsUnicodeQuery) 2418 | { 2419 | p += (len + 1) * sizeof(WCHAR); 2420 | } 2421 | else 2422 | { 2423 | p += (len + 1) * sizeof(CHAR); 2424 | } 2425 | } 2426 | 2427 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_RUN_COUNT) 2428 | { 2429 | if (dwRequestType == EVERYTHING_REQUEST_RUN_COUNT) 2430 | { 2431 | return p; 2432 | } 2433 | 2434 | p += sizeof(DWORD); 2435 | } 2436 | 2437 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_RUN) 2438 | { 2439 | if (dwRequestType == EVERYTHING_REQUEST_DATE_RUN) 2440 | { 2441 | return p; 2442 | } 2443 | 2444 | p += sizeof(FILETIME); 2445 | } 2446 | 2447 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED) 2448 | { 2449 | if (dwRequestType == EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED) 2450 | { 2451 | return p; 2452 | } 2453 | 2454 | p += sizeof(FILETIME); 2455 | } 2456 | 2457 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME) 2458 | { 2459 | DWORD len; 2460 | 2461 | if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME) 2462 | { 2463 | return p; 2464 | } 2465 | 2466 | len = *(DWORD *)p; 2467 | p += sizeof(DWORD); 2468 | 2469 | if (_Everything_IsUnicodeQuery) 2470 | { 2471 | p += (len + 1) * sizeof(WCHAR); 2472 | } 2473 | else 2474 | { 2475 | p += (len + 1) * sizeof(CHAR); 2476 | } 2477 | } 2478 | 2479 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_PATH) 2480 | { 2481 | DWORD len; 2482 | 2483 | if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_PATH) 2484 | { 2485 | return p; 2486 | } 2487 | 2488 | len = *(DWORD *)p; 2489 | p += sizeof(DWORD); 2490 | 2491 | if (_Everything_IsUnicodeQuery) 2492 | { 2493 | p += (len + 1) * sizeof(WCHAR); 2494 | } 2495 | else 2496 | { 2497 | p += (len + 1) * sizeof(CHAR); 2498 | } 2499 | } 2500 | 2501 | if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME) 2502 | { 2503 | DWORD len; 2504 | 2505 | if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME) 2506 | { 2507 | return p; 2508 | } 2509 | 2510 | len = *(DWORD *)p; 2511 | p += sizeof(DWORD); 2512 | 2513 | if (_Everything_IsUnicodeQuery) 2514 | { 2515 | p += (len + 1) * sizeof(WCHAR); 2516 | } 2517 | else 2518 | { 2519 | p += (len + 1) * sizeof(CHAR); 2520 | } 2521 | } 2522 | 2523 | return NULL; 2524 | } 2525 | 2526 | static BOOL _Everything_IsSchemeNameW(LPCWSTR s) 2527 | { 2528 | LPCWSTR p; 2529 | 2530 | p = s; 2531 | 2532 | while(*p) 2533 | { 2534 | if (*p == ':') 2535 | { 2536 | p++; 2537 | 2538 | if ((p[0] == '/') && (p[1] == '/')) 2539 | { 2540 | return TRUE; 2541 | } 2542 | 2543 | break; 2544 | } 2545 | 2546 | p++; 2547 | } 2548 | 2549 | return FALSE; 2550 | } 2551 | 2552 | static BOOL _Everything_IsSchemeNameA(LPCSTR s) 2553 | { 2554 | LPCSTR p; 2555 | 2556 | p = s; 2557 | 2558 | while(*p) 2559 | { 2560 | if (*p == ':') 2561 | { 2562 | p++; 2563 | 2564 | if ((p[0] == '/') && (p[1] == '/')) 2565 | { 2566 | return TRUE; 2567 | } 2568 | 2569 | break; 2570 | } 2571 | 2572 | p++; 2573 | } 2574 | 2575 | return FALSE; 2576 | } 2577 | 2578 | static void _Everything_ChangeWindowMessageFilter(HWND hwnd) 2579 | { 2580 | if (!_Everything_GotChangeWindowMessageFilterEx) 2581 | { 2582 | // allow the everything window to send a reply. 2583 | _Everything_user32_hdll = LoadLibraryW(L"user32.dll"); 2584 | 2585 | if (_Everything_user32_hdll) 2586 | { 2587 | _Everything_pChangeWindowMessageFilterEx = (BOOL (WINAPI *)(HWND hWnd,UINT message,DWORD action,_EVERYTHING_PCHANGEFILTERSTRUCT pChangeFilterStruct))GetProcAddress(_Everything_user32_hdll,"ChangeWindowMessageFilterEx"); 2588 | } 2589 | 2590 | _Everything_GotChangeWindowMessageFilterEx = 1; 2591 | } 2592 | 2593 | if (_Everything_GotChangeWindowMessageFilterEx) 2594 | { 2595 | if (_Everything_pChangeWindowMessageFilterEx) 2596 | { 2597 | _Everything_pChangeWindowMessageFilterEx(hwnd,WM_COPYDATA,_EVERYTHING_MSGFLT_ALLOW,0); 2598 | } 2599 | } 2600 | } 2601 | 2602 | static LPCWSTR _Everything_GetResultRequestStringW(DWORD dwIndex,DWORD dwRequestType) 2603 | { 2604 | LPCWSTR str; 2605 | 2606 | _Everything_Lock(); 2607 | 2608 | if ((_Everything_List2) && (_Everything_IsUnicodeQuery)) 2609 | { 2610 | if (_Everything_IsValidResultIndex(dwIndex)) 2611 | { 2612 | str = _Everything_GetRequestData(dwIndex,dwRequestType); 2613 | if (str) 2614 | { 2615 | // skip length in characters. 2616 | str = (LPCWSTR)(((char *)str) + sizeof(DWORD)); 2617 | } 2618 | else 2619 | { 2620 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 2621 | } 2622 | } 2623 | else 2624 | { 2625 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 2626 | 2627 | str = NULL; 2628 | } 2629 | } 2630 | else 2631 | { 2632 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 2633 | 2634 | str = NULL; 2635 | } 2636 | 2637 | _Everything_Unlock(); 2638 | 2639 | return str; 2640 | } 2641 | 2642 | static LPCSTR _Everything_GetResultRequestStringA(DWORD dwIndex,DWORD dwRequestType) 2643 | { 2644 | LPCSTR str; 2645 | 2646 | _Everything_Lock(); 2647 | 2648 | if ((_Everything_List2) && (!_Everything_IsUnicodeQuery)) 2649 | { 2650 | if (_Everything_IsValidResultIndex(dwIndex)) 2651 | { 2652 | str = _Everything_GetRequestData(dwIndex,dwRequestType); 2653 | if (str) 2654 | { 2655 | // skip length in characters. 2656 | str = (LPCSTR)(((char *)str) + sizeof(DWORD)); 2657 | } 2658 | else 2659 | { 2660 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 2661 | } 2662 | } 2663 | else 2664 | { 2665 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 2666 | 2667 | str = NULL; 2668 | } 2669 | } 2670 | else 2671 | { 2672 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 2673 | 2674 | str = NULL; 2675 | } 2676 | 2677 | _Everything_Unlock(); 2678 | 2679 | return str; 2680 | } 2681 | 2682 | static BOOL _Everything_GetResultRequestData(DWORD dwIndex,DWORD dwRequestType,void *data,int size) 2683 | { 2684 | BOOL ret; 2685 | 2686 | _Everything_Lock(); 2687 | 2688 | if (_Everything_List2) 2689 | { 2690 | if (_Everything_IsValidResultIndex(dwIndex)) 2691 | { 2692 | void *request_data; 2693 | 2694 | request_data = _Everything_GetRequestData(dwIndex,dwRequestType); 2695 | if (request_data) 2696 | { 2697 | CopyMemory(data,request_data,size); 2698 | 2699 | ret = TRUE; 2700 | } 2701 | else 2702 | { 2703 | _Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST; 2704 | 2705 | ret = FALSE; 2706 | } 2707 | } 2708 | else 2709 | { 2710 | _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; 2711 | 2712 | ret = FALSE; 2713 | } 2714 | } 2715 | else 2716 | { 2717 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 2718 | 2719 | ret = FALSE; 2720 | } 2721 | 2722 | _Everything_Unlock(); 2723 | 2724 | return ret; 2725 | } 2726 | 2727 | LPCWSTR EVERYTHINGAPI Everything_GetResultExtensionW(DWORD dwIndex) 2728 | { 2729 | return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_EXTENSION); 2730 | } 2731 | 2732 | LPCSTR EVERYTHINGAPI Everything_GetResultExtensionA(DWORD dwIndex) 2733 | { 2734 | return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_EXTENSION); 2735 | } 2736 | 2737 | BOOL EVERYTHINGAPI Everything_GetResultSize(DWORD dwIndex,LARGE_INTEGER *lpSize) 2738 | { 2739 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_SIZE,lpSize,sizeof(LARGE_INTEGER)); 2740 | } 2741 | 2742 | BOOL EVERYTHINGAPI Everything_GetResultDateCreated(DWORD dwIndex,FILETIME *lpDateCreated) 2743 | { 2744 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_CREATED,lpDateCreated,sizeof(FILETIME)); 2745 | } 2746 | 2747 | BOOL EVERYTHINGAPI Everything_GetResultDateModified(DWORD dwIndex,FILETIME *lpDateModified) 2748 | { 2749 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_MODIFIED,lpDateModified,sizeof(FILETIME)); 2750 | } 2751 | 2752 | BOOL EVERYTHINGAPI Everything_GetResultDateAccessed(DWORD dwIndex,FILETIME *lpDateAccessed) 2753 | { 2754 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_ACCESSED,lpDateAccessed,sizeof(FILETIME)); 2755 | } 2756 | 2757 | DWORD EVERYTHINGAPI Everything_GetResultAttributes(DWORD dwIndex) 2758 | { 2759 | DWORD dwAttributes; 2760 | 2761 | if (_Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_ATTRIBUTES,&dwAttributes,sizeof(DWORD))) 2762 | { 2763 | return dwAttributes; 2764 | } 2765 | 2766 | return INVALID_FILE_ATTRIBUTES; 2767 | } 2768 | 2769 | LPCWSTR EVERYTHINGAPI Everything_GetResultFileListFileNameW(DWORD dwIndex) 2770 | { 2771 | return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_FILE_LIST_FILE_NAME); 2772 | } 2773 | 2774 | LPCSTR EVERYTHINGAPI Everything_GetResultFileListFileNameA(DWORD dwIndex) 2775 | { 2776 | return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_FILE_LIST_FILE_NAME); 2777 | } 2778 | 2779 | DWORD EVERYTHINGAPI Everything_GetResultRunCount(DWORD dwIndex) 2780 | { 2781 | DWORD dwRunCount; 2782 | 2783 | if (_Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_RUN_COUNT,&dwRunCount,sizeof(DWORD))) 2784 | { 2785 | return dwRunCount; 2786 | } 2787 | 2788 | return 0; 2789 | } 2790 | 2791 | BOOL EVERYTHINGAPI Everything_GetResultDateRun(DWORD dwIndex,FILETIME *lpDateRun) 2792 | { 2793 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_RUN,lpDateRun,sizeof(FILETIME)); 2794 | } 2795 | 2796 | BOOL EVERYTHINGAPI Everything_GetResultDateRecentlyChanged(DWORD dwIndex,FILETIME *lpDateRecentlyChanged) 2797 | { 2798 | return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED,lpDateRecentlyChanged,sizeof(FILETIME)); 2799 | } 2800 | 2801 | LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameW(DWORD dwIndex) 2802 | { 2803 | return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME); 2804 | } 2805 | 2806 | LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameA(DWORD dwIndex) 2807 | { 2808 | return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME); 2809 | } 2810 | 2811 | LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedPathW(DWORD dwIndex) 2812 | { 2813 | return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_PATH); 2814 | } 2815 | 2816 | LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedPathA(DWORD dwIndex) 2817 | { 2818 | return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_PATH); 2819 | } 2820 | 2821 | LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameW(DWORD dwIndex) 2822 | { 2823 | return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME); 2824 | } 2825 | 2826 | LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameA(DWORD dwIndex) 2827 | { 2828 | return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME); 2829 | } 2830 | 2831 | static BOOL _Everything_SendAPIBoolCommand(int command,LPARAM lParam) 2832 | { 2833 | HWND everything_hwnd; 2834 | 2835 | everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 2836 | if (everything_hwnd) 2837 | { 2838 | _Everything_LastError = 0; 2839 | 2840 | if (SendMessage(everything_hwnd,EVERYTHING_WM_IPC,command,lParam)) 2841 | { 2842 | return TRUE; 2843 | } 2844 | else 2845 | { 2846 | return FALSE; 2847 | } 2848 | } 2849 | else 2850 | { 2851 | // the everything window was not found. 2852 | // we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and 2853 | // wait for Everything to post this message to all top level windows when its up and running. 2854 | _Everything_LastError = EVERYTHING_ERROR_IPC; 2855 | 2856 | return FALSE; 2857 | } 2858 | } 2859 | 2860 | static DWORD _Everything_SendAPIDwordCommand(int command,LPARAM lParam) 2861 | { 2862 | HWND everything_hwnd; 2863 | 2864 | everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 2865 | if (everything_hwnd) 2866 | { 2867 | _Everything_LastError = 0; 2868 | 2869 | return (DWORD)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,command,lParam); 2870 | } 2871 | else 2872 | { 2873 | // the everything window was not found. 2874 | // we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and 2875 | // wait for Everything to post this message to all top level windows when its up and running. 2876 | _Everything_LastError = EVERYTHING_ERROR_IPC; 2877 | 2878 | return 0; 2879 | } 2880 | } 2881 | 2882 | BOOL EVERYTHINGAPI Everything_IsDBLoaded(void) 2883 | { 2884 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_DB_LOADED,0); 2885 | } 2886 | 2887 | BOOL EVERYTHINGAPI Everything_IsAdmin(void) 2888 | { 2889 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_ADMIN,0); 2890 | } 2891 | 2892 | BOOL EVERYTHINGAPI Everything_IsAppData(void) 2893 | { 2894 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_APPDATA,0); 2895 | } 2896 | 2897 | BOOL EVERYTHINGAPI Everything_RebuildDB(void) 2898 | { 2899 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_REBUILD_DB,0); 2900 | } 2901 | 2902 | BOOL EVERYTHINGAPI Everything_UpdateAllFolderIndexes(void) 2903 | { 2904 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES,0); 2905 | } 2906 | 2907 | BOOL EVERYTHINGAPI Everything_SaveDB(void) 2908 | { 2909 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_SAVE_DB,0); 2910 | } 2911 | 2912 | BOOL EVERYTHINGAPI Everything_SaveRunHistory(void) 2913 | { 2914 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_SAVE_RUN_HISTORY,0); 2915 | } 2916 | 2917 | BOOL EVERYTHINGAPI Everything_DeleteRunHistory(void) 2918 | { 2919 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_DELETE_RUN_HISTORY,0); 2920 | } 2921 | 2922 | DWORD EVERYTHINGAPI Everything_GetMajorVersion(void) 2923 | { 2924 | return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_MAJOR_VERSION,0); 2925 | } 2926 | 2927 | DWORD EVERYTHINGAPI Everything_GetMinorVersion(void) 2928 | { 2929 | return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_MINOR_VERSION,0); 2930 | } 2931 | 2932 | DWORD EVERYTHINGAPI Everything_GetRevision(void) 2933 | { 2934 | return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_REVISION,0); 2935 | } 2936 | 2937 | DWORD EVERYTHINGAPI Everything_GetBuildNumber(void) 2938 | { 2939 | return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_BUILD_NUMBER,0); 2940 | } 2941 | 2942 | DWORD EVERYTHINGAPI Everything_GetTargetMachine(void) 2943 | { 2944 | return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_TARGET_MACHINE,0); 2945 | } 2946 | 2947 | BOOL EVERYTHINGAPI Everything_Exit(void) 2948 | { 2949 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_EXIT,0); 2950 | } 2951 | 2952 | BOOL EVERYTHINGAPI Everything_IsFastSort(DWORD sortType) 2953 | { 2954 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_FAST_SORT,(LPARAM)sortType); 2955 | } 2956 | 2957 | BOOL EVERYTHINGAPI Everything_IsFileInfoIndexed(DWORD fileInfoType) 2958 | { 2959 | return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_FILE_INFO_INDEXED,(LPARAM)fileInfoType); 2960 | } 2961 | 2962 | static LRESULT _Everything_SendCopyData(int command,const void *data,int size) 2963 | { 2964 | HWND everything_hwnd; 2965 | 2966 | everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); 2967 | if (everything_hwnd) 2968 | { 2969 | COPYDATASTRUCT cds; 2970 | 2971 | cds.cbData = size; 2972 | cds.dwData = command; 2973 | cds.lpData = (void *)data; 2974 | 2975 | return SendMessage(everything_hwnd,WM_COPYDATA,0,(LPARAM)&cds); 2976 | } 2977 | else 2978 | { 2979 | // the everything window was not found. 2980 | // we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and 2981 | // wait for Everything to post this message to all top level windows when its up and running. 2982 | _Everything_LastError = EVERYTHING_ERROR_IPC; 2983 | 2984 | return FALSE; 2985 | } 2986 | } 2987 | 2988 | DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameW(LPCWSTR lpFileName) 2989 | { 2990 | return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTW,lpFileName,(_Everything_StringLengthW(lpFileName) + 1) * sizeof(WCHAR)); 2991 | } 2992 | 2993 | DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameA(LPCSTR lpFileName) 2994 | { 2995 | return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA,lpFileName,_Everything_StringLengthA(lpFileName) + 1); 2996 | } 2997 | 2998 | BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameW(LPCWSTR lpFileName,DWORD dwRunCount) 2999 | { 3000 | EVERYTHING_IPC_RUN_HISTORY *run_history; 3001 | DWORD len; 3002 | BOOL ret; 3003 | 3004 | len = _Everything_StringLengthW(lpFileName); 3005 | 3006 | run_history = _Everything_Alloc(sizeof(EVERYTHING_IPC_RUN_HISTORY) + ((len + 1) * sizeof(WCHAR))); 3007 | 3008 | if (run_history) 3009 | { 3010 | run_history->run_count = dwRunCount; 3011 | CopyMemory(run_history + 1,lpFileName,((len + 1) * sizeof(WCHAR))); 3012 | 3013 | if (_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTW,run_history,sizeof(EVERYTHING_IPC_RUN_HISTORY) + ((len + 1) * sizeof(WCHAR)))) 3014 | { 3015 | ret = TRUE; 3016 | } 3017 | else 3018 | { 3019 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 3020 | 3021 | ret = FALSE; 3022 | } 3023 | 3024 | _Everything_Free(run_history); 3025 | } 3026 | else 3027 | { 3028 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 3029 | 3030 | ret = FALSE; 3031 | } 3032 | 3033 | return ret; 3034 | } 3035 | 3036 | BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameA(LPCSTR lpFileName,DWORD dwRunCount) 3037 | { 3038 | EVERYTHING_IPC_RUN_HISTORY *run_history; 3039 | DWORD len; 3040 | BOOL ret; 3041 | 3042 | len = _Everything_StringLengthA(lpFileName); 3043 | 3044 | run_history = _Everything_Alloc(sizeof(EVERYTHING_IPC_RUN_HISTORY) + (len + 1)); 3045 | 3046 | if (run_history) 3047 | { 3048 | run_history->run_count = dwRunCount; 3049 | CopyMemory(run_history + 1,lpFileName,(len + 1)); 3050 | 3051 | if (_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTA,run_history,sizeof(EVERYTHING_IPC_RUN_HISTORY) + (len + 1))) 3052 | { 3053 | ret = TRUE; 3054 | } 3055 | else 3056 | { 3057 | _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; 3058 | 3059 | ret = FALSE; 3060 | } 3061 | 3062 | _Everything_Free(run_history); 3063 | } 3064 | else 3065 | { 3066 | _Everything_LastError = EVERYTHING_ERROR_MEMORY; 3067 | 3068 | ret = FALSE; 3069 | } 3070 | 3071 | return ret; 3072 | } 3073 | 3074 | DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameW(LPCWSTR lpFileName) 3075 | { 3076 | return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTW,lpFileName,(_Everything_StringLengthW(lpFileName) + 1) * sizeof(WCHAR)); 3077 | } 3078 | 3079 | DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameA(LPCSTR lpFileName) 3080 | { 3081 | return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTA,lpFileName,_Everything_StringLengthA(lpFileName) + 1); 3082 | } 3083 | 3084 | -------------------------------------------------------------------------------- /PyEverything/__init__.py: -------------------------------------------------------------------------------- 1 | from ._PyEverything import * 2 | from .__version__ import __version__ -------------------------------------------------------------------------------- /PyEverything/__version__.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.4.0' -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PyEverything 2 | Python bindings for the Everything Service API 3 | 4 | Everything is a windows-based program that lets a user index and very quickly search on the order of millions of files. 5 | There is an SDK for the program, which is written in C. 6 | 7 | PyEverything is exactly what the name suggests: Python bindings for the C functionality so that python scripters can leverage this extremely powerful service. 8 | 9 | ### Requirements 10 | 1. Python 3.7 64-bit or later. 11 | 2. Windows 12 | 3. Everything Service 1.4.1+ installed https://www.voidtools.com/ 13 | 14 | ### Installation 15 | 16 | pip install git+https://github.com/nambread/PyEverything#egg=PyEverything 17 | 18 | This will pull the latest release. Add "@vx.x.x" after the url to pull a specific version. Eg: 19 | 20 | pip install git+https://github.com/nambread/PyEverything@v0.4.0#egg=PyEverything 21 | 22 | If your version of python is not officially supported, but you still wish to use it, follow the "Building from Source" instructions. 23 | 24 | ## Usage 25 | Basic API usages involves three main phases: 26 | 1. Set up the query search state 27 | 2. Submit the query 28 | 3. Iterate over the resulting data via index 29 | ### example 30 | 31 | import PyEverything 32 | 33 | PyEverything.SetSearch("example") 34 | PyEverything.Query() 35 | for i in PyEverything.GetNumResults(): 36 | print(PyEverything.GetResultFullPathName(i)) 37 | #results will get printed out here. 38 | 39 | The full Everything SDK is here: [https://www.voidtools.com/support/everything/sdk/](https://www.voidtools.com/support/everything/sdk/) 40 | There are some key differences between the python SDK and the C one. 41 | 42 | ### Python Key Differences 43 | 44 | #### Return Types 45 | There are several functions that provide some data in the C API, and do so by requiring a pointer to a buffer that the API then fills. 46 | For example, on [https://www.voidtools.com/support/everything/sdk/everything_getresultfullpathname/](https://www.voidtools.com/support/everything/sdk/everything_getresultfullpathname/) 47 | 48 | TCHAR buf[MAX_PATH]; 49 | 50 | // set the search text to abc AND 123 51 | Everything_SetSearch("abc 123"); 52 | 53 | // execute the query 54 | Everything_Query(TRUE); 55 | 56 | // Get the full path and file name of the first visible result. 57 | Everything_GetResultFullPathName(0,buf,sizeof(buf) / sizeof(TCHAR)); 58 | In PyEverything, this will be a returned string: 59 | 60 | #set the search text to abc AND 123 61 | PyEverything.SetSearch("abc 123") 62 | 63 | #execute the query 64 | PyEverything.Query(True) 65 | 66 | #Get the full path and file name of the first visible result. 67 | result = PyEverything.GetResultFullPathName(0) 68 | 69 | Functions that return a date will return `None` if that data could not be queried. (Which might be the case with incomplete indexes of drives that are no longer available.) 70 | 71 | GetResultDateAccessed() 72 | GetResultDateCreated() 73 | GetResultDateModified() 74 | GetResultDateRecentlyChanged() 75 | GetResultDateRun() 76 | 77 | #### Error Handling 78 | A large portion of the C API returns error codes, which the user must handle. 79 | For example, on [https://www.voidtools.com/support/everything/sdk/everything_getlasterror/](https://www.voidtools.com/support/everything/sdk/everything_getlasterror/) 80 | 81 | // execute the query 82 | if (!Everything_Query(true)) 83 | { 84 | DWORD dwLastError = Everything_GetLastError(); 85 | if (dwLastError == EVERYTHING_ERROR_IPC) 86 | { 87 | // IPC not available. 88 | } 89 | } 90 | In Python, this is instead a `RuntimeError`: 91 | 92 | >>> import PyEverything 93 | >>> PyEverything.SetSearch("abc 123") 94 | >>> PyEverything.Query() #Raises PyEverything.ERROR_IPC 95 | Traceback (most recent call last): 96 | File "", line 1, in 97 | RuntimeError: Everything API returned error code: 2 98 | The numerical value of the exception is the same as on the above GetLastError page. 99 | 100 | #### Namespaces 101 | C lacks namespaces, so all Everything SDK methods and variables have the "Everything_" prefix. 102 | the "PyEverything" package is already a namespace, so this prefix has been dropped everywhere that it appears. Keyboard switches are expensive, you shouldn't wear them out! 103 | 104 | # Building from Source 105 | 106 | Building from source is done via python and setuptools. The extension module is created with pybind11, a super easy to use library that lets users wrap complex C code and expose it in a .pyd file. 107 | ### dependencies 108 | 109 | - Pybind11 (included in repo) : https://github.com/pybind/pybind11 110 | - Everything SDK (included in repo) : [https://www.voidtools.com/support/everything/sdk/](https://www.voidtools.com/support/everything/sdk/) 111 | - Python 3.7 64 bit environment 112 | - wheel from pypi: `pip install wheel` 113 | - VS 2015 build tools or later (Dependent on Python version. For more information on that, [check out this page](https://wiki.python.org/moin/WindowsCompilers) 114 | 115 | ### Instructions 116 | 1. Clone this repo and initialise submodules: 117 | * `git clone --recurse-submodules https://github.com/nambread/PyEverything` 118 | 2. Activate your virtual environment of choice. 119 | 3. CD to the root repo folder and run `python setup.py bdist_wheel` 120 | 4. You should get a wheel for your python version put in the newly created .\dist folder. 121 | 5. `pip install path/to/wheel.whl` 122 | -------------------------------------------------------------------------------- /create_builds.bat: -------------------------------------------------------------------------------- 1 | rmdir /Q /S .\build 2 | rmdir /Q /S .\dist 3 | call env37\scripts\activate 4 | python setup.py bdist_wheel 5 | call env38\scripts\activate 6 | python setup.py bdist_wheel 7 | call env39\scripts\activate 8 | python setup.py bdist_wheel -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, Extension, find_packages 2 | import os 3 | import pathlib 4 | 5 | desc = ''' 6 | Search Everything SDK, but in python! 7 | ''' 8 | here = os.path.abspath(os.path.dirname(__file__)) 9 | 10 | about = {} 11 | NAME = 'PyEverything' 12 | with open(os.path.join(here, NAME, '__version__.py')) as f: 13 | exec(f.read(), about) 14 | VERSION = about['__version__'] 15 | 16 | # The text of the README file 17 | README = (pathlib.Path(here) / "README.md").read_text() 18 | 19 | pyd_ext = Extension('PyEverything._PyEverything', 20 | ['PyEverything/_PyEverything/PyEverything.cpp', 21 | 'PyEverything/_PyEverything/vendor/Everything-SDK/src/Everything.c'], 22 | include_dirs=[ 23 | 'pybind11/include', 24 | 'PyEverything/_PyEverything/vendor/Everything-SDK/include', 25 | 'PyEverything/_PyEverything/vendor/Everything-SDK/ipc' 26 | ], 27 | define_macros=[('_CRT_SECURE_NO_WARNINGS', None),('UNICODE', None)], 28 | library_dirs=[], 29 | libraries=[]) 30 | 31 | setup( 32 | name=NAME, 33 | description='Search Everything SDK, but in python.', 34 | version = VERSION, 35 | author='Michael Nam', 36 | author_email='michael.nam@namination.co.uk', 37 | license='MIT', 38 | url='https://github.com/nambread/PyEverything', 39 | packages=[NAME], 40 | ext_modules = [pyd_ext], 41 | include_package_data=True, 42 | package_data={NAME: ['_PyEverything.pyi']}, 43 | python_requires = '>=3.7,<3.10', 44 | long_description=README, 45 | long_description_content_type="text/markdown", 46 | platforms = ['windows'], 47 | classifiers=[ 48 | 'License :: OSI Approved :: MIT License', 49 | 'Programming Language :: Python', 50 | 'Programming Language :: Python :: 3 :: Only', 51 | 'Programming Language :: Python :: 3.7', 52 | 'Programming Language :: Python :: 3.8', 53 | 'Programming Language :: Python :: 3.9', 54 | 'Programming Language :: Python :: Implementation :: CPython', 55 | 56 | ] 57 | ) --------------------------------------------------------------------------------