├── .gitattributes ├── Resource ├── Icon.ico ├── Preview.png ├── Everything │ ├── Everything.exe │ └── Everything.lng ├── Icon.svg └── Translations │ └── vcc_zh_CN.ts ├── Source ├── Resource.qrc ├── ThirdParty │ ├── MinHook │ │ ├── dll │ │ │ ├── MinHook.x64.dll │ │ │ └── MinHook.x86.dll │ │ ├── lib │ │ │ ├── MinHook.x64.lib │ │ │ └── MinHook.x86.lib │ │ └── include │ │ │ └── MinHook.h │ └── Everything-SDK │ │ ├── example │ │ ├── dll.test.c │ │ ├── dll.test.cpp │ │ ├── CSharp │ │ │ ├── Properties │ │ │ │ ├── Settings.settings │ │ │ │ ├── Settings.Designer.cs │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Resources.Designer.cs │ │ │ │ └── Resources.resx │ │ │ ├── Program.cs │ │ │ ├── WindowsApplication1.sln │ │ │ ├── Form1.Designer.cs │ │ │ ├── WindowsApplication1.csproj │ │ │ ├── Form1.resx │ │ │ └── Form1.cs │ │ ├── CSharpx64 │ │ │ ├── Properties │ │ │ │ ├── Settings.settings │ │ │ │ ├── Settings.Designer.cs │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Resources.Designer.cs │ │ │ │ └── Resources.resx │ │ │ ├── Program.cs │ │ │ ├── WindowsApplication1.sln │ │ │ ├── Form1.Designer.cs │ │ │ ├── WindowsApplication1.csproj │ │ │ ├── Form1.resx │ │ │ └── Form1.cs │ │ └── Visual Basic │ │ │ └── WindowsApplication1 │ │ │ ├── WindowsApplication1 │ │ │ ├── My Project │ │ │ │ ├── Settings.settings │ │ │ │ ├── Application.myapp │ │ │ │ ├── AssemblyInfo.vb │ │ │ │ ├── Application.Designer.vb │ │ │ │ ├── Resources.Designer.vb │ │ │ │ ├── Settings.Designer.vb │ │ │ │ └── Resources.resx │ │ │ ├── Form1.Designer.vb │ │ │ ├── Form1.vb │ │ │ ├── WindowsApplication1.vbproj │ │ │ └── Form1.resx │ │ │ └── WindowsApplication1.sln │ │ ├── dll │ │ ├── Everything32.dll │ │ └── Everything64.dll │ │ ├── lib │ │ ├── Everything32.lib │ │ └── Everything64.lib │ │ └── src │ │ ├── Everything32.def │ │ └── Everything64.def ├── Resource.h ├── Config.h ├── Utils.h ├── IEverything.h ├── Resource.rc ├── Utils.cpp ├── MainWindow.h ├── MainWindow.ui └── IEverything.cpp ├── LICENSE ├── Build ├── VsCacheCleaner.sln ├── VsCacheCleaner.vcxproj.filters └── VsCacheCleaner.vcxproj ├── CONTRIBUTING.md ├── README-CN.md ├── README.md └── .gitignore /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Resource/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Resource/Icon.ico -------------------------------------------------------------------------------- /Resource/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Resource/Preview.png -------------------------------------------------------------------------------- /Resource/Everything/Everything.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Resource/Everything/Everything.exe -------------------------------------------------------------------------------- /Resource/Everything/Everything.lng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Resource/Everything/Everything.lng -------------------------------------------------------------------------------- /Source/Resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ../Resource/Icon.svg 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/ThirdParty/MinHook/dll/MinHook.x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/MinHook/dll/MinHook.x64.dll -------------------------------------------------------------------------------- /Source/ThirdParty/MinHook/dll/MinHook.x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/MinHook/dll/MinHook.x86.dll -------------------------------------------------------------------------------- /Source/ThirdParty/MinHook/lib/MinHook.x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/MinHook/lib/MinHook.x64.lib -------------------------------------------------------------------------------- /Source/ThirdParty/MinHook/lib/MinHook.x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/MinHook/lib/MinHook.x86.lib -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/dll.test.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/example/dll.test.c -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/dll/Everything32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/dll/Everything32.dll -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/dll/Everything64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/dll/Everything64.dll -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/dll.test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/example/dll.test.cpp -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/lib/Everything32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/lib/Everything32.lib -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/lib/Everything64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpriteOvO/VsCacheCleaner/HEAD/Source/ThirdParty/Everything-SDK/lib/Everything64.lib -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace WindowsApplication1 6 | { 7 | 8 | static class Program 9 | { 10 | 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | 20 | Application.Run(new Form1()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace WindowsApplication1 6 | { 7 | 8 | static class Program 9 | { 10 | 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | 20 | Application.Run(new Form1()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | Form1 5 | false 6 | 0 7 | true 8 | 0 9 | true 10 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsApplication1", "WindowsApplication1\WindowsApplication1.vbproj", "{0D15552C-AEB4-4B1A-8CCD-1E533557EDA1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {0D15552C-AEB4-4B1A-8CCD-1E533557EDA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {0D15552C-AEB4-4B1A-8CCD-1E533557EDA1}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {0D15552C-AEB4-4B1A-8CCD-1E533557EDA1}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {0D15552C-AEB4-4B1A-8CCD-1E533557EDA1}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2021 SpriteOvO 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Build/VsCacheCleaner.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30709.132 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VsCacheCleaner", "VsCacheCleaner.vcxproj", "{D111AB45-333B-463B-BC30-813DA8AFA933}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D111AB45-333B-463B-BC30-813DA8AFA933}.Debug|x86.ActiveCfg = Debug|Win32 15 | {D111AB45-333B-463B-BC30-813DA8AFA933}.Debug|x86.Build.0 = Debug|Win32 16 | {D111AB45-333B-463B-BC30-813DA8AFA933}.Release|x86.ActiveCfg = Release|Win32 17 | {D111AB45-333B-463B-BC30-813DA8AFA933}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {CBB9B6DC-214D-4883-8BE1-84B99833F2DF} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Source/Config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined TO_STRING && !defined __TO_STRING 4 | # define __TO_STRING(value) # value 5 | # define TO_STRING(value) __TO_STRING(value) 6 | #endif 7 | 8 | #define VCC_VERSION_MAJOR 1 9 | #define VCC_VERSION_MINOR 0 10 | #define VCC_VERSION_BUILD 0 11 | 12 | #define VCC_VERSION_STRING TO_STRING(VCC_VERSION_MAJOR) "." TO_STRING(VCC_VERSION_MINOR) "." TO_STRING(VCC_VERSION_BUILD) 13 | #define VCC_VERSION_RSRC_NUM VCC_VERSION_MAJOR, VCC_VERSION_MINOR, VCC_VERSION_BUILD, 0 14 | #define VCC_VERSION_RSRC_STR VCC_VERSION_STRING ".0" 15 | 16 | #define VCC_OWNER_REPO "SpriteOvO/VsCacheCleaner" 17 | #define VCC_URL_REPO "https://github.com/" VCC_OWNER_REPO 18 | #define VCC_URL_ISSUES VCC_URL_REPO "/issues" 19 | #define VCC_URL_RELEASES VCC_URL_REPO "/releases" 20 | #define VCC_URL_LICENSE VCC_URL_REPO "/blob/main/LICENSE" 21 | #define VCC_URL_CURRENT_RELEASE VCC_URL_RELEASES "/tag/" VCC_VERSION_STRING 22 | #define VCC_LICENSE "MIT License" 23 | #define VCC_RESOURCE_ICON ":/VsCacheCleaner/Resource/Icon.svg" 24 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | ## :earth_africa: Translate 4 | 5 | *VsCacheCleaner* is developed using *Qt* for the UI part. 6 | 7 | You can use [*Qt Linguist*](https://doc.qt.io/qt-5/qtlinguist-index.html) to easily translate *VsCacheCleaner*. 8 | 9 | Please [open an issue](https://github.com/SpriteOvO/VsCacheCleaner/issues/new/choose) and tell us the target language to request the `.ts` translation file. 10 | 11 | Open the `.ts` translation file through *Qt Linguist* to start the translation, see the *Qt Linguist* [documentation](https://doc.qt.io/qt-5/linguist-translators.html) for more details. 12 | 13 | When you finish translating, save the `.ts` translation file and [submit a PR](https://github.com/SpriteOvO/VsCacheCleaner/compare) to us for review and merge. 14 | 15 | If you need any help, please feel free to [open an issue](https://github.com/SpriteOvO/VsCacheCleaner/issues/new/choose). 16 | 17 | ## :rocket: Improve code 18 | [Submit a PR](https://github.com/SpriteOvO/VsCacheCleaner/compare) to fix a known bug or try something from the TODO list. 19 | 20 | But we recommend that you [open an issue](https://github.com/SpriteOvO/VsCacheCleaner/issues/new/choose) for discussion before that. 21 | 22 | --- 23 | 24 | :heart: Thank you in advance for your contribution. -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/WindowsApplication1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApplication1", "WindowsApplication1.csproj", "{FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Debug|x86 = Debug|x86 10 | Release|Any CPU = Release|Any CPU 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x86.ActiveCfg = Debug|x86 17 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x86.Build.0 = Debug|x86 18 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x86.ActiveCfg = Release|x86 21 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x86.Build.0 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WindowsApplication1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsApplication1")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("00417877-82e2-4176-8724-bbe7870ee348")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WindowsApplication1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsApplication1")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("00417877-82e2-4176-8724-bbe7870ee348")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:2.0.50727.5485 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes, 18 | ' or if you encounter build errors in this file, go to the Project Designer 19 | ' (go to Project Properties or double-click the My Project node in 20 | ' Solution Explorer), and make changes on the Application tab. 21 | ' 22 | Partial Friend Class MyApplication 23 | 24 | _ 25 | Public Sub New() 26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) 27 | Me.IsSingleInstance = false 28 | Me.EnableVisualStyles = true 29 | Me.SaveMySettingsOnExit = true 30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses 31 | End Sub 32 | 33 | _ 34 | Protected Overrides Sub OnCreateMainForm() 35 | Me.MainForm = Global.WindowsApplication1.Form1 36 | End Sub 37 | End Class 38 | End Namespace 39 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/WindowsApplication1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApplication1", "WindowsApplication1.csproj", "{FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Debug|x64 = Debug|x64 10 | Debug|x86 = Debug|x86 11 | Release|Any CPU = Release|Any CPU 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x64.ActiveCfg = Debug|x64 19 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x64.Build.0 = Debug|x64 20 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x86.ActiveCfg = Debug|x86 21 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Debug|x86.Build.0 = Debug|x86 22 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x64.ActiveCfg = Release|x64 25 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x64.Build.0 = Release|x64 26 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x86.ActiveCfg = Release|x86 27 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1}.Release|x86.Build.0 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /README-CN.md: -------------------------------------------------------------------------------- 1 |

2 | Icon 3 |
4 | VsCacheCleaner 5 |

6 |

清理 Visual Studio 解决方案缓存,拯救你的磁盘空间!

7 |

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

18 |

:earth_americas: English | :earth_asia: 简体中文

19 | 20 | ## :page_with_curl: 描述 21 | *Visual Studio 解决方案缓存文件夹* `.vs` 用于 *Visual Studio* 存储已打开的文档、断点和其他有关解决方案状态的信息。 22 | 23 | 通常它们可以安全地被删除。 24 | 25 | 如果您没有定期手动删除这些缓存,它们就会不断吃掉你磁盘的空闲空间,使磁盘空间条变为红色。:t-rex: 26 | 27 | 现在,你拥有了这个! 28 | 29 | ## :mag: 预览 30 | ![](/Resource/Preview.png) 31 | 32 | ## :sparkles: 特性 33 | * 从指定路径或所有磁盘扫描 *Visual Studio 解决方案缓存文件夹* `.vs`。 34 | * 扫描非常快(通常在 1 秒内完成并显示结果)。 35 | * 支持按路径、缓存大小和最后访问日期排序。 36 | * 支持按规则勾选缓存项(最后访问于某段时间前或超过某个大小)。 37 | * 显示缓存大小和磁盘空间大小的统计图表。 38 | * 删除实际是移动到*回收站*,以便您可以做最后确认。 39 | * 多语言支持。 40 | 41 | ## :hammer_and_wrench: 构建 42 | 构建要求 *Visual Studio 2019* 和 [*Qt 5.12.9*](https://download.qt.io/official_releases/qt/5.12/5.12.9/qt-opensource-windows-x86-5.12.9.exe.mirrorlist)。 43 | 44 | ## :beer: 贡献 45 | *VsCacheCleaner* 是一个开源项目,您可以通过以下方式贡献: 46 | * [打开问题](https://github.com/SpriteOvO/VsCacheCleaner/issues/new/choose)来报告错误或建议新功能。 47 | * [翻译](/CONTRIBUTING.md#earth_africa-translate)尚未支持的语言或[改进](/CONTRIBUTING.md#earth_africa-translate)现有翻译。 48 | * [提交 PR](https://github.com/SpriteOvO/VsCacheCleaner/compare) 来修复已知 BUG 或尝试 TODO 列表中的事项。 49 | 50 | 查看[贡献准则](/CONTRIBUTING.md)。 51 | 52 | ## :gem: 第三方 53 | * Qt 5.12.9 ([GPLv3 License](https://doc.qt.io/qt-5/gpl.html)) 54 | * Everything ([MIT License](https://www.voidtools.com/License.txt)) 55 | * MinHook ([BSD 2-Clause License](https://github.com/TsudaKageyu/minhook/blob/master/LICENSE.txt)) 56 | 57 | ## :rotating_light: 许可 58 | *VsCacheCleaner* 是根据 [MIT License](/LICENSE) 许可的。依赖项根据其各自的许可证许可。 59 | 60 | ## :warning: 免责声明 61 | *VsCacheCleaner* 不提供任何保证,使用过程中产生的一切意外后果由您自己承担。 -------------------------------------------------------------------------------- /Resource/Icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 23 | 25 | image/svg+xml 26 | 28 | 29 | 30 | 31 | 51 | 53 | 56 | 57 | 62 | 63 | -------------------------------------------------------------------------------- /Source/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | #if !defined TO_STRING && !defined __TO_STRING 11 | # define __TO_STRING(value) # value 12 | # define TO_STRING(value) __TO_STRING(value) 13 | #endif 14 | 15 | #define DEFER_EX(var, lambda) DeferT var { lambda } 16 | #define DEFER(lambda) DEFER_EX(__DefererTemp_ ## __LINE__, lambda) 17 | 18 | #define VCC_ASSERT(condition) while (!(condition)) { FatalError("File: " __FILE__ "\nLine: " TO_STRING(__LINE__) "\nCode: " # condition, true); } 19 | 20 | 21 | namespace Constant 22 | { 23 | constexpr inline uint64_t SizeKb = 1024; 24 | constexpr inline uint64_t SizeMb = SizeKb * 1024; 25 | constexpr inline uint64_t SizeGb = SizeMb * 1024; 26 | constexpr inline uint64_t SizeTb = SizeGb * 1024; 27 | 28 | } // namespace Constant 29 | 30 | class NonCopyable 31 | { 32 | protected: 33 | NonCopyable() = default; 34 | ~NonCopyable() = default; 35 | 36 | NonCopyable(const NonCopyable &) = delete; 37 | NonCopyable& operator=(const NonCopyable &) = delete; 38 | }; 39 | 40 | template 41 | class DeferT final : NonCopyable 42 | { 43 | public: 44 | explicit inline DeferT(FunctionT Function) : 45 | _Function{std::move(Function)} 46 | { 47 | } 48 | 49 | inline ~DeferT() 50 | { 51 | if (!_IsCanceled) { 52 | _Function(); 53 | } 54 | } 55 | 56 | inline void Cancel() 57 | { 58 | _IsCanceled = true; 59 | } 60 | 61 | private: 62 | FunctionT _Function; 63 | bool _IsCanceled = false; 64 | 65 | }; 66 | 67 | [[noreturn]] void FatalError(const QString &Message, bool Report = true); 68 | 69 | namespace Text 70 | { 71 | QString FormatDataSize(uint64_t DataSize); 72 | QString FormatTime(const QDateTime &DateTime); 73 | 74 | } // namespace Text 75 | 76 | namespace File 77 | { 78 | void OpenFolder(const QString &Path); 79 | bool MoveToTrash(const QString &File); 80 | 81 | } // namespace File 82 | 83 | namespace Process 84 | { 85 | struct InfoT 86 | { 87 | uint32_t Id; 88 | uint32_t ParentId; 89 | uint32_t ThreadsCount; 90 | uint32_t ThreadsBasePriority; 91 | QString Name; 92 | }; 93 | 94 | bool EnumProcesses(const std::function &Callback); 95 | 96 | } // namespace Process 97 | 98 | namespace System 99 | { 100 | QDateTime SystemTimeToQDateTime(const SYSTEMTIME &Time); 101 | bool SingleInstance(const QString &InstanceName); 102 | 103 | } // namespace System 104 | -------------------------------------------------------------------------------- /Source/IEverything.h: -------------------------------------------------------------------------------- 1 | // 2 | // Everything-SDK Wrapper 3 | // 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "Utils.h" 15 | 16 | 17 | namespace Et 18 | { 19 | enum class ItemTypeE : uint32_t 20 | { 21 | Unknown = 0, 22 | File, 23 | Folder 24 | }; 25 | 26 | enum class SearchOptionE : uint32_t 27 | { 28 | // Require type 29 | // 30 | RequireFile = (1 << 0), 31 | RequireFolder = (1 << 1), 32 | 33 | // Require data 34 | // 35 | RequireAccessedDate = (1 << 5), 36 | 37 | // Match rule 38 | // 39 | MatchCase = (1 << 16), 40 | MatchWholeWord = (1 << 17), 41 | MatchWholeFileName = (1 << 18) 42 | }; 43 | Q_DECLARE_FLAGS(SearchOptionsT, SearchOptionE) 44 | Q_DECLARE_OPERATORS_FOR_FLAGS(SearchOptionsT); 45 | 46 | struct ItemDataT 47 | { 48 | ItemTypeE Type; 49 | QString FullPathName; 50 | QString FileName; 51 | std::optional DataSize; 52 | QDateTime AccessedDate; 53 | }; 54 | 55 | } // namespace Et 56 | 57 | class IEverything 58 | { 59 | public: 60 | static IEverything& GetInstance(); 61 | 62 | IEverything(); 63 | ~IEverything(); 64 | 65 | void LaunchBackend(); 66 | void ExitBackend(); 67 | 68 | bool IsInitialized(); 69 | uint32_t GetErrorCode(); 70 | 71 | std::optional> Search( 72 | const QString &String, 73 | const Et::SearchOptionsT &SearchOptions 74 | ); 75 | 76 | private: 77 | std::atomic _IsLaunched = false; 78 | PROCESS_INFORMATION _ProcessInfo; 79 | 80 | void PrepareLaunch(); 81 | bool SearchQuery(const QString &String, const Et::SearchOptionsT &SearchOptions); 82 | Et::ItemDataT GetResultData(uint32_t Index); 83 | 84 | void CheckErrorCausedByIPC(); 85 | 86 | // Workaround to make the Everything-SDK support multiple instances 87 | // 88 | 89 | template || std::is_same_v>> 90 | using FnFindWindowT = HWND(__stdcall *)(const CharT *ClassName, const CharT *WindowName); 91 | 92 | template || std::is_same_v>> 93 | static inline FnFindWindowT _FnOriginalFindWindow; 94 | 95 | template || std::is_same_v>> 96 | static HWND __stdcall DetourFindWindow(const CharT *ClassName, const CharT *WindowName); 97 | }; 98 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsApplication1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button1 = new System.Windows.Forms.Button(); 32 | this.listBox1 = new System.Windows.Forms.ListBox(); 33 | this.textBox1 = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // button1 37 | // 38 | this.button1.Location = new System.Drawing.Point(250, 12); 39 | this.button1.Name = "button1"; 40 | this.button1.Size = new System.Drawing.Size(84, 20); 41 | this.button1.TabIndex = 0; 42 | this.button1.Text = "Search"; 43 | this.button1.UseVisualStyleBackColor = true; 44 | this.button1.Click += new System.EventHandler(this.button1_Click); 45 | // 46 | // listBox1 47 | // 48 | this.listBox1.FormattingEnabled = true; 49 | this.listBox1.Location = new System.Drawing.Point(12, 38); 50 | this.listBox1.Name = "listBox1"; 51 | this.listBox1.Size = new System.Drawing.Size(322, 199); 52 | this.listBox1.TabIndex = 2; 53 | // 54 | // textBox1 55 | // 56 | this.textBox1.Location = new System.Drawing.Point(12, 12); 57 | this.textBox1.Name = "textBox1"; 58 | this.textBox1.Size = new System.Drawing.Size(232, 20); 59 | this.textBox1.TabIndex = 3; 60 | // 61 | // Form1 62 | // 63 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 64 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 65 | this.ClientSize = new System.Drawing.Size(349, 251); 66 | this.Controls.Add(this.textBox1); 67 | this.Controls.Add(this.listBox1); 68 | this.Controls.Add(this.button1); 69 | this.Name = "Form1"; 70 | this.Text = "Form1"; 71 | this.ResumeLayout(false); 72 | this.PerformLayout(); 73 | 74 | } 75 | 76 | #endregion 77 | 78 | private System.Windows.Forms.Button button1; 79 | private System.Windows.Forms.ListBox listBox1; 80 | private System.Windows.Forms.TextBox textBox1; 81 | } 82 | } 83 | 84 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsApplication1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsApplication1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/Form1.Designer.vb: -------------------------------------------------------------------------------- 1 | _ 2 | Partial Class Form1 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Me.Button1 = New System.Windows.Forms.Button 26 | Me.TextBox1 = New System.Windows.Forms.TextBox 27 | Me.ListBox1 = New System.Windows.Forms.ListBox 28 | Me.SuspendLayout() 29 | ' 30 | 'Button1 31 | ' 32 | Me.Button1.Location = New System.Drawing.Point(524, 98) 33 | Me.Button1.Name = "Button1" 34 | Me.Button1.Size = New System.Drawing.Size(100, 24) 35 | Me.Button1.TabIndex = 0 36 | Me.Button1.Text = "Button1" 37 | Me.Button1.UseVisualStyleBackColor = True 38 | ' 39 | 'TextBox1 40 | ' 41 | Me.TextBox1.Location = New System.Drawing.Point(50, 102) 42 | Me.TextBox1.Name = "TextBox1" 43 | Me.TextBox1.Size = New System.Drawing.Size(468, 20) 44 | Me.TextBox1.TabIndex = 1 45 | ' 46 | 'ListBox1 47 | ' 48 | Me.ListBox1.FormattingEnabled = True 49 | Me.ListBox1.Location = New System.Drawing.Point(50, 155) 50 | Me.ListBox1.Name = "ListBox1" 51 | Me.ListBox1.Size = New System.Drawing.Size(574, 394) 52 | Me.ListBox1.TabIndex = 2 53 | ' 54 | 'Form1 55 | ' 56 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) 57 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 58 | Me.ClientSize = New System.Drawing.Size(822, 796) 59 | Me.Controls.Add(Me.ListBox1) 60 | Me.Controls.Add(Me.TextBox1) 61 | Me.Controls.Add(Me.Button1) 62 | Me.Name = "Form1" 63 | Me.Text = "Form1" 64 | Me.ResumeLayout(False) 65 | Me.PerformLayout() 66 | 67 | End Sub 68 | Friend WithEvents Button1 As System.Windows.Forms.Button 69 | Friend WithEvents TextBox1 As System.Windows.Forms.TextBox 70 | Friend WithEvents ListBox1 As System.Windows.Forms.ListBox 71 | 72 | End Class 73 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:2.0.50727.5485 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | Imports System 15 | 16 | Namespace My.Resources 17 | 18 | 'This class was auto-generated by the StronglyTypedResourceBuilder 19 | 'class via a tool like ResGen or Visual Studio. 20 | 'To add or remove a member, edit your .ResX file then rerun ResGen 21 | 'with the /str option, or rebuild your VS project. 22 | ''' 23 | ''' A strongly-typed resource class, for looking up localized strings, etc. 24 | ''' 25 | _ 29 | Friend Module Resources 30 | 31 | Private resourceMan As Global.System.Resources.ResourceManager 32 | 33 | Private resourceCulture As Global.System.Globalization.CultureInfo 34 | 35 | ''' 36 | ''' Returns the cached ResourceManager instance used by this class. 37 | ''' 38 | _ 39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 40 | Get 41 | If Object.ReferenceEquals(resourceMan, Nothing) Then 42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApplication1.Resources", GetType(Resources).Assembly) 43 | resourceMan = temp 44 | End If 45 | Return resourceMan 46 | End Get 47 | End Property 48 | 49 | ''' 50 | ''' Overrides the current thread's CurrentUICulture property for all 51 | ''' resource lookups using this strongly typed resource class. 52 | ''' 53 | _ 54 | Friend Property Culture() As Global.System.Globalization.CultureInfo 55 | Get 56 | Return resourceCulture 57 | End Get 58 | Set 59 | resourceCulture = value 60 | End Set 61 | End Property 62 | End Module 63 | End Namespace 64 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsApplication1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button1 = new System.Windows.Forms.Button(); 32 | this.listBox1 = new System.Windows.Forms.ListBox(); 33 | this.textBox1 = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // button1 37 | // 38 | this.button1.Location = new System.Drawing.Point(250, 12); 39 | this.button1.Name = "button1"; 40 | this.button1.Size = new System.Drawing.Size(84, 20); 41 | this.button1.TabIndex = 0; 42 | this.button1.Text = "Search"; 43 | this.button1.UseVisualStyleBackColor = true; 44 | this.button1.Click += new System.EventHandler(this.button1_Click); 45 | // 46 | // listBox1 47 | // 48 | this.listBox1.FormattingEnabled = true; 49 | this.listBox1.Location = new System.Drawing.Point(12, 38); 50 | this.listBox1.Name = "listBox1"; 51 | this.listBox1.Size = new System.Drawing.Size(762, 498); 52 | this.listBox1.TabIndex = 2; 53 | // 54 | // textBox1 55 | // 56 | this.textBox1.Location = new System.Drawing.Point(12, 12); 57 | this.textBox1.Name = "textBox1"; 58 | this.textBox1.Size = new System.Drawing.Size(232, 20); 59 | this.textBox1.TabIndex = 3; 60 | // 61 | // Form1 62 | // 63 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 64 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 65 | this.ClientSize = new System.Drawing.Size(786, 553); 66 | this.Controls.Add(this.textBox1); 67 | this.Controls.Add(this.listBox1); 68 | this.Controls.Add(this.button1); 69 | this.Name = "Form1"; 70 | this.Text = "Form1"; 71 | this.ResumeLayout(false); 72 | this.PerformLayout(); 73 | 74 | } 75 | 76 | #endregion 77 | 78 | private System.Windows.Forms.Button button1; 79 | private System.Windows.Forms.ListBox listBox1; 80 | private System.Windows.Forms.TextBox textBox1; 81 | } 82 | } 83 | 84 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/src/Everything32.def: -------------------------------------------------------------------------------- 1 | LIBRARY Everything32 2 | 3 | EXPORTS 4 | 5 | Everything_GetLastError 6 | 7 | Everything_SetSearchA 8 | Everything_SetSearchW 9 | Everything_SetMatchPath 10 | Everything_SetMatchCase 11 | Everything_SetMatchWholeWord 12 | Everything_SetRegex 13 | Everything_SetMax 14 | Everything_SetOffset 15 | Everything_SetReplyID 16 | Everything_SetReplyWindow 17 | 18 | Everything_GetSearchA 19 | Everything_GetSearchW 20 | Everything_GetMatchPath 21 | Everything_GetMatchCase 22 | Everything_GetMatchWholeWord 23 | Everything_GetRegex 24 | Everything_GetMax 25 | Everything_GetOffset 26 | Everything_GetReplyID 27 | Everything_GetReplyWindow 28 | 29 | Everything_QueryA 30 | Everything_QueryW 31 | 32 | Everything_IsQueryReply 33 | 34 | Everything_SortResultsByPath 35 | 36 | Everything_GetNumFileResults 37 | Everything_GetNumFolderResults 38 | Everything_GetNumResults 39 | Everything_GetTotFileResults 40 | Everything_GetTotFolderResults 41 | Everything_GetTotResults 42 | 43 | Everything_IsVolumeResult 44 | Everything_IsFolderResult 45 | Everything_IsFileResult 46 | 47 | Everything_GetResultFileNameA 48 | Everything_GetResultFileNameW 49 | Everything_GetResultPathA 50 | Everything_GetResultPathW 51 | Everything_GetResultFullPathNameA 52 | Everything_GetResultFullPathNameW 53 | 54 | Everything_Reset 55 | Everything_CleanUp 56 | 57 | Everything_SetSort 58 | Everything_SetRequestFlags 59 | Everything_GetSort 60 | Everything_GetRequestFlags 61 | Everything_GetResultListSort 62 | Everything_GetResultListRequestFlags 63 | Everything_GetResultExtensionW 64 | Everything_GetResultExtensionA 65 | Everything_GetResultSize 66 | Everything_GetResultDateCreated 67 | Everything_GetResultDateModified 68 | Everything_GetResultDateAccessed 69 | Everything_GetResultAttributes 70 | Everything_GetResultFileListFileNameW 71 | Everything_GetResultFileListFileNameA 72 | Everything_GetResultRunCount 73 | Everything_GetResultDateRun 74 | Everything_GetResultDateRecentlyChanged 75 | Everything_GetResultHighlightedFileNameW 76 | Everything_GetResultHighlightedFileNameA 77 | Everything_GetResultHighlightedPathW 78 | Everything_GetResultHighlightedPathA 79 | Everything_GetResultHighlightedFullPathAndFileNameW 80 | Everything_GetResultHighlightedFullPathAndFileNameA 81 | Everything_GetMajorVersion 82 | Everything_GetMinorVersion 83 | Everything_GetRevision 84 | Everything_GetBuildNumber 85 | Everything_Exit 86 | Everything_IsDBLoaded 87 | Everything_IsAdmin 88 | Everything_IsAppData 89 | Everything_RebuildDB 90 | Everything_UpdateAllFolderIndexes 91 | Everything_SaveDB 92 | Everything_SaveRunHistory 93 | Everything_DeleteRunHistory 94 | Everything_GetTargetMachine 95 | Everything_IsFastSort 96 | Everything_IsFileInfoIndexed 97 | Everything_GetRunCountFromFileNameW 98 | Everything_GetRunCountFromFileNameA 99 | Everything_SetRunCountFromFileNameW 100 | Everything_SetRunCountFromFileNameA 101 | Everything_IncRunCountFromFileNameW 102 | Everything_IncRunCountFromFileNameA 103 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/src/Everything64.def: -------------------------------------------------------------------------------- 1 | LIBRARY Everything64 2 | 3 | EXPORTS 4 | 5 | Everything_GetLastError 6 | 7 | Everything_SetSearchA 8 | Everything_SetSearchW 9 | Everything_SetMatchPath 10 | Everything_SetMatchCase 11 | Everything_SetMatchWholeWord 12 | Everything_SetRegex 13 | Everything_SetMax 14 | Everything_SetOffset 15 | Everything_SetReplyID 16 | Everything_SetReplyWindow 17 | 18 | Everything_GetSearchA 19 | Everything_GetSearchW 20 | Everything_GetMatchPath 21 | Everything_GetMatchCase 22 | Everything_GetMatchWholeWord 23 | Everything_GetRegex 24 | Everything_GetMax 25 | Everything_GetOffset 26 | Everything_GetReplyID 27 | Everything_GetReplyWindow 28 | 29 | Everything_QueryA 30 | Everything_QueryW 31 | 32 | Everything_IsQueryReply 33 | 34 | Everything_SortResultsByPath 35 | 36 | Everything_GetNumFileResults 37 | Everything_GetNumFolderResults 38 | Everything_GetNumResults 39 | Everything_GetTotFileResults 40 | Everything_GetTotFolderResults 41 | Everything_GetTotResults 42 | 43 | Everything_IsVolumeResult 44 | Everything_IsFolderResult 45 | Everything_IsFileResult 46 | 47 | Everything_GetResultFileNameA 48 | Everything_GetResultFileNameW 49 | Everything_GetResultPathA 50 | Everything_GetResultPathW 51 | Everything_GetResultFullPathNameA 52 | Everything_GetResultFullPathNameW 53 | 54 | Everything_Reset 55 | Everything_CleanUp 56 | 57 | Everything_SetSort 58 | Everything_SetRequestFlags 59 | Everything_GetSort 60 | Everything_GetRequestFlags 61 | Everything_GetResultListSort 62 | Everything_GetResultListRequestFlags 63 | Everything_GetResultExtensionW 64 | Everything_GetResultExtensionA 65 | Everything_GetResultSize 66 | Everything_GetResultDateCreated 67 | Everything_GetResultDateModified 68 | Everything_GetResultDateAccessed 69 | Everything_GetResultAttributes 70 | Everything_GetResultFileListFileNameW 71 | Everything_GetResultFileListFileNameA 72 | Everything_GetResultRunCount 73 | Everything_GetResultDateRun 74 | Everything_GetResultDateRecentlyChanged 75 | Everything_GetResultHighlightedFileNameW 76 | Everything_GetResultHighlightedFileNameA 77 | Everything_GetResultHighlightedPathW 78 | Everything_GetResultHighlightedPathA 79 | Everything_GetResultHighlightedFullPathAndFileNameW 80 | Everything_GetResultHighlightedFullPathAndFileNameA 81 | Everything_GetMajorVersion 82 | Everything_GetMinorVersion 83 | Everything_GetRevision 84 | Everything_GetBuildNumber 85 | Everything_Exit 86 | Everything_IsDBLoaded 87 | Everything_IsAdmin 88 | Everything_IsAppData 89 | Everything_RebuildDB 90 | Everything_UpdateAllFolderIndexes 91 | Everything_SaveDB 92 | Everything_SaveRunHistory 93 | Everything_DeleteRunHistory 94 | Everything_GetTargetMachine 95 | Everything_IsFastSort 96 | Everything_IsFileInfoIndexed 97 | Everything_GetRunCountFromFileNameW 98 | Everything_GetRunCountFromFileNameA 99 | Everything_SetRunCountFromFileNameW 100 | Everything_SetRunCountFromFileNameA 101 | Everything_IncRunCountFromFileNameW 102 | Everything_IncRunCountFromFileNameA 103 | -------------------------------------------------------------------------------- /Source/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | 5 | #include "Resource.h" 6 | #include "Config.h" 7 | 8 | #define APSTUDIO_READONLY_SYMBOLS 9 | ///////////////////////////////////////////////////////////////////////////// 10 | // 11 | // Generated from the TEXTINCLUDE 2 resource. 12 | // 13 | #include "winres.h" 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | #undef APSTUDIO_READONLY_SYMBOLS 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // Chinese (Simplified, PRC) resources 20 | 21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) 22 | LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "Resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""winres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Icon 53 | // 54 | 55 | // Icon with lowest ID value placed first to ensure application icon 56 | // remains consistent on all systems. 57 | IDI_ICON1 ICON "..\\Resource\\Icon.ico" 58 | 59 | 60 | ///////////////////////////////////////////////////////////////////////////// 61 | // 62 | // Version 63 | // 64 | 65 | VS_VERSION_INFO VERSIONINFO 66 | FILEVERSION VCC_VERSION_RSRC_NUM 67 | PRODUCTVERSION VCC_VERSION_RSRC_NUM 68 | FILEFLAGSMASK 0x3fL 69 | #ifdef _DEBUG 70 | FILEFLAGS 0x1L 71 | #else 72 | FILEFLAGS 0x0L 73 | #endif 74 | FILEOS 0x40004L 75 | FILETYPE 0x1L 76 | FILESUBTYPE 0x0L 77 | BEGIN 78 | BLOCK "StringFileInfo" 79 | BEGIN 80 | BLOCK "080004b0" 81 | BEGIN 82 | VALUE "CompanyName", "SpriteOvO" 83 | VALUE "FileDescription", "Visual Studio Solution Cache Cleaner" 84 | VALUE "FileVersion", VCC_VERSION_RSRC_STR 85 | VALUE "InternalName", "VsCacheCleaner.exe" 86 | VALUE "LegalCopyright", "Copyright (C) 2020-2021 SpriteOvO. All rights reserved." 87 | VALUE "OriginalFilename", "VsCacheCleaner.exe" 88 | VALUE "ProductName", "VsCacheCleaner" 89 | VALUE "ProductVersion", VCC_VERSION_RSRC_STR 90 | END 91 | END 92 | BLOCK "VarFileInfo" 93 | BEGIN 94 | VALUE "Translation", 0x800, 1200 95 | END 96 | END 97 | 98 | #endif // Chinese (Simplified, PRC) resources 99 | ///////////////////////////////////////////////////////////////////////////// 100 | 101 | 102 | 103 | #ifndef APSTUDIO_INVOKED 104 | ///////////////////////////////////////////////////////////////////////////// 105 | // 106 | // Generated from the TEXTINCLUDE 3 resource. 107 | // 108 | 109 | 110 | ///////////////////////////////////////////////////////////////////////////// 111 | #endif // not APSTUDIO_INVOKED 112 | 113 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Icon 3 |
4 | VsCacheCleaner 5 |

6 |

Clear the Visual Studio solution cache, free up your disk space!

7 |

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

18 |

:earth_americas: English | :earth_asia: 简体中文

19 | 20 | ## :page_with_curl: Description 21 | *Visual Studio solution cache folder* `.vs` is required by *Visual Studio* to store opened documents, breakpoints, and other information about state of the solution. 22 | 23 | Usually they can be safely deleted. 24 | 25 | If you don't delete these caches manually on a regular basis, they will keep eating up the free space of your disk, making the disk space bar turn red. :t-rex: 26 | 27 | And now you have this! 28 | 29 | ## :mag: Preview 30 | ![](/Resource/Preview.png) 31 | 32 | ## :sparkles: Features 33 | * Scan the *Visual Studio solution cache folder* `.vs` from a specified path or all disks. 34 | * Scanning is very fast (usually completed and results displayed within 1sec). 35 | * Support sorting by path, cache size, and last accessed date. 36 | * Support checking cache items by rules (last accessed some time ago or greater than some size). 37 | * Display stats chart for cache size and disk space size. 38 | * Deleting is actually moving to the *Recycle Bin* so that you can make a final confirmation. 39 | * Multi-language support. 40 | 41 | ## :hammer_and_wrench: Build 42 | Build requirements *Visual Studio 2019* and [*Qt 5.12.9*](https://download.qt.io/official_releases/qt/5.12/5.12.9/qt-opensource-windows-x86-5.12.9.exe.mirrorlist). 43 | 44 | ## :beer: Contribute 45 | *VsCacheCleaner* is an open source project, here are some ways you can contribute: 46 | * [Open an issue](https://github.com/SpriteOvO/VsCacheCleaner/issues/new/choose) to report bugs or suggest new features. 47 | * [Translate](/CONTRIBUTING.md#earth_africa-translate) unsupported languages or [improve](/CONTRIBUTING.md#earth_africa-translate) existing translations. 48 | * [Submit a PR](https://github.com/SpriteOvO/VsCacheCleaner/compare) to fix a known bug or try something from the TODO list. 49 | 50 | See [contribution guidelines](/CONTRIBUTING.md). 51 | 52 | ## :gem: ThirdParty 53 | * Qt 5.12.9 ([GPLv3 License](https://doc.qt.io/qt-5/gpl.html)) 54 | * Everything ([MIT License](https://www.voidtools.com/License.txt)) 55 | * MinHook ([BSD 2-Clause License](https://github.com/TsudaKageyu/minhook/blob/master/LICENSE.txt)) 56 | 57 | ## :rotating_light: License 58 | *VsCacheCleaner* is licensed under the [MIT License](/LICENSE). Dependencies are licensed under their respective licenses. 59 | 60 | ## :warning: Disclaimer 61 | *VsCacheCleaner* makes no warranties, and you are solely responsible for any unintended consequences of your use. -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:2.0.50727.5485 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.WindowsApplication1.My.MySettings 68 | Get 69 | Return Global.WindowsApplication1.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/WindowsApplication1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Debug 4 | AnyCPU 5 | 8.0.50727 6 | 2.0 7 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1} 8 | WinExe 9 | Properties 10 | WindowsApplication1 11 | WindowsApplication1 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug\ 18 | DEBUG;TRACE 19 | prompt 20 | 4 21 | 22 | 23 | pdbonly 24 | true 25 | bin\Release\ 26 | TRACE 27 | prompt 28 | 4 29 | 30 | 31 | true 32 | bin\x86\Debug\ 33 | DEBUG;TRACE 34 | full 35 | x86 36 | prompt 37 | 38 | 39 | bin\x86\Release\ 40 | TRACE 41 | true 42 | pdbonly 43 | x86 44 | prompt 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Form 57 | 58 | 59 | Form1.cs 60 | 61 | 62 | 63 | 64 | Designer 65 | Form1.cs 66 | 67 | 68 | ResXFileCodeGenerator 69 | Resources.Designer.cs 70 | Designer 71 | 72 | 73 | True 74 | Resources.resx 75 | 76 | 77 | SettingsSingleFileGenerator 78 | Settings.Designer.cs 79 | 80 | 81 | True 82 | Settings.settings 83 | True 84 | 85 | 86 | 87 | 94 | -------------------------------------------------------------------------------- /Build/VsCacheCleaner.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 18 | ui 19 | 20 | 21 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 22 | qrc;* 23 | false 24 | 25 | 26 | {1124ca4d-4a64-40dc-a612-1587179e1ee8} 27 | 28 | 29 | {552fa0d7-39cb-4c9f-8e3f-d56f16e11b1b} 30 | 31 | 32 | {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} 33 | ts 34 | false 35 | 36 | 37 | {3c172ac3-938f-45fc-89fd-4bbfddeede4c} 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | 52 | 53 | ThirdParty\Everything-SDK 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | Header Files 63 | 64 | 65 | Header Files 66 | 67 | 68 | ThirdParty\MinHook 69 | 70 | 71 | 72 | 73 | Resource Files 74 | 75 | 76 | 77 | 78 | Resource Files 79 | 80 | 81 | 82 | 83 | Resource Files 84 | 85 | 86 | 87 | 88 | Resource Files 89 | 90 | 91 | 92 | 93 | Header Files 94 | 95 | 96 | 97 | 98 | Resource Files 99 | 100 | 101 | Resource Files\Translation Files 102 | 103 | 104 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/Form1.vb: -------------------------------------------------------------------------------- 1 | ' Add an Imports statement at the top of the class, structure, or 2 | ' module that uses the DllImport attribute. 3 | 4 | Public Class Form1 5 | 6 | Public Declare Unicode Function Everything_SetSearchW Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal search As String) As UInt32 7 | Public Declare Unicode Function Everything_SetRequestFlags Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal dwRequestFlags As UInt32) As UInt32 8 | Public Declare Unicode Function Everything_QueryW Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal bWait As Integer) As Integer 9 | Public Declare Unicode Function Everything_GetNumResults Lib "d:\dev\everything\sdk\dll\Everything32.dll" () As UInt32 10 | Public Declare Unicode Function Everything_GetResultFileNameW Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal index As UInt32) As IntPtr 11 | Public Declare Unicode Function Everything_GetLastError Lib "d:\dev\everything\sdk\dll\Everything32.dll" () As UInt32 12 | Public Declare Unicode Function Everything_GetResultFullPathNameW Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal index As UInt32, ByVal buf As System.Text.StringBuilder, ByVal size As UInt32) As UInt32 13 | Public Declare Unicode Function Everything_GetResultSize Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal index As UInt32, ByRef size As UInt64) As Integer 14 | Public Declare Unicode Function Everything_GetResultDateModified Lib "d:\dev\everything\sdk\dll\Everything32.dll" (ByVal index As UInt32, ByRef ft As UInt64) As Integer 15 | 16 | Public Const EVERYTHING_REQUEST_FILE_NAME = &H1 17 | Public Const EVERYTHING_REQUEST_PATH = &H00000002 18 | Public Const EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = &H00000004 19 | Public Const EVERYTHING_REQUEST_EXTENSION = &H00000008 20 | Public Const EVERYTHING_REQUEST_SIZE = &H00000010 21 | Public Const EVERYTHING_REQUEST_DATE_CREATED = &H00000020 22 | Public Const EVERYTHING_REQUEST_DATE_MODIFIED = &H00000040 23 | Public Const EVERYTHING_REQUEST_DATE_ACCESSED = &H00000080 24 | Public Const EVERYTHING_REQUEST_ATTRIBUTES = &H00000100 25 | Public Const EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = &H00000200 26 | Public Const EVERYTHING_REQUEST_RUN_COUNT = &H00000400 27 | Public Const EVERYTHING_REQUEST_DATE_RUN = &H00000800 28 | Public Const EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = &H00001000 29 | Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = &H00002000 30 | Public Const EVERYTHING_REQUEST_HIGHLIGHTED_PATH = &H00004000 31 | Public Const EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = &H00008000 32 | 33 | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 34 | 35 | Everything_SetSearchW(TextBox1.Text) 36 | Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME Or EVERYTHING_REQUEST_PATH Or EVERYTHING_REQUEST_SIZE Or EVERYTHING_REQUEST_DATE_MODIFIED) 37 | Everything_QueryW(1) 38 | 39 | Dim NumResults As UInt32 40 | Dim i As UInt32 41 | Dim filename As New System.Text.StringBuilder(260) 42 | Dim size As UInt64 43 | Dim ftdm As UInt64 44 | Dim DateModified As System.DateTime 45 | 46 | NumResults = Everything_GetNumResults() 47 | 48 | ListBox1.Items.Clear() 49 | 50 | If NumResults > 0 Then 51 | For i = 0 To NumResults - 1 52 | 53 | Everything_GetResultFullPathNameW(i, filename, filename.Capacity) 54 | Everything_GetResultSize(i, size) 55 | Everything_GetResultDateModified(i, ftdm) 56 | 57 | DateModified = System.DateTime.FromFileTime(ftdm) 58 | 59 | ' ListBox1.Items.Insert(i, filename.ToString() & " size:" & size & " date:" & DateModified.ToString()) 60 | ListBox1.Items.Insert(i, System.Runtime.InteropServices.Marshal.PtrToStringUni(Everything_GetResultFileNameW(i)) & " Size:" & size & " Date Modified:" & DateModified.ToString()) 61 | 62 | Next 63 | End If 64 | 65 | End Sub 66 | 67 | End Class 68 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {0D15552C-AEB4-4B1A-8CCD-1E533557EDA1} 9 | WinExe 10 | WindowsApplication1.My.MyApplication 11 | WindowsApplication1 12 | WindowsApplication1 13 | WindowsForms 14 | 15 | 16 | true 17 | full 18 | true 19 | true 20 | bin\Debug\ 21 | WindowsApplication1.xml 22 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 23 | x86 24 | 25 | 26 | pdbonly 27 | false 28 | true 29 | true 30 | bin\Release\ 31 | WindowsApplication1.xml 32 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Form 55 | 56 | 57 | Form1.vb 58 | Form 59 | 60 | 61 | 62 | True 63 | Application.myapp 64 | 65 | 66 | True 67 | True 68 | Resources.resx 69 | 70 | 71 | True 72 | Settings.settings 73 | True 74 | 75 | 76 | 77 | 78 | Designer 79 | Form1.vb 80 | 81 | 82 | VbMyResourcesResXFileCodeGenerator 83 | Resources.Designer.vb 84 | My.Resources 85 | Designer 86 | 87 | 88 | 89 | 90 | MyApplicationCodeGenerator 91 | Application.Designer.vb 92 | 93 | 94 | SettingsSingleFileGenerator 95 | My 96 | Settings.Designer.vb 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/WindowsApplication1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Debug 4 | AnyCPU 5 | 8.0.50727 6 | 2.0 7 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1} 8 | WinExe 9 | Properties 10 | WindowsApplication1 11 | WindowsApplication1 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug\ 18 | DEBUG;TRACE 19 | prompt 20 | 4 21 | 22 | 23 | pdbonly 24 | true 25 | bin\Release\ 26 | TRACE 27 | prompt 28 | 4 29 | 30 | 31 | true 32 | bin\x86\Debug\ 33 | DEBUG;TRACE 34 | full 35 | x86 36 | prompt 37 | 38 | 39 | bin\x86\Release\ 40 | TRACE 41 | true 42 | pdbonly 43 | x86 44 | prompt 45 | 46 | 47 | true 48 | bin\x64\Debug\ 49 | DEBUG;TRACE 50 | full 51 | x64 52 | prompt 53 | 54 | 55 | bin\x64\Release\ 56 | TRACE 57 | true 58 | pdbonly 59 | x64 60 | prompt 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Form 73 | 74 | 75 | Form1.cs 76 | 77 | 78 | 79 | 80 | Designer 81 | Form1.cs 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | Designer 87 | 88 | 89 | True 90 | Resources.resx 91 | 92 | 93 | SettingsSingleFileGenerator 94 | Settings.Designer.cs 95 | 96 | 97 | True 98 | Settings.settings 99 | True 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/My Project/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/Visual Basic/WindowsApplication1/WindowsApplication1/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Source/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "Utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "Config.h" 11 | 12 | 13 | void FatalError(const QString &Message, bool Report) 14 | { 15 | QString Content; 16 | 17 | if (Report) 18 | { 19 | Content = QObject::tr( 20 | "An error has occurred!\n" 21 | "Please help us fix this problem.\n" 22 | "--------------------------------------------------\n" 23 | "\n" 24 | "%1\n" 25 | "\n" 26 | "--------------------------------------------------\n" 27 | "Click \"Abort\" or \"Ignore\" will pop up GitHub issue tracker page.\n" 28 | "You can submit this information to us there.\n" 29 | "Thank you very much!" 30 | ).arg(Message); 31 | } 32 | else { 33 | Content = Message; 34 | } 35 | 36 | int Result; 37 | do { 38 | Result = MessageBoxW( 39 | nullptr, 40 | Content.toStdWString().c_str(), 41 | QObject::tr("VsCacheCleaner fatal error").toStdWString().c_str(), 42 | MB_ABORTRETRYIGNORE | MB_ICONERROR 43 | ); 44 | #if defined _DEBUG 45 | if (Result == IDRETRY) { 46 | __debugbreak(); 47 | } 48 | #endif 49 | } while (Result == IDRETRY); 50 | 51 | #if !defined _DEBUG 52 | if (Report) { 53 | QDesktopServices::openUrl(QUrl{VCC_URL_ISSUES}); 54 | } 55 | #endif 56 | 57 | exit(EXIT_FAILURE); 58 | } 59 | 60 | namespace Text 61 | { 62 | QString FormatDataSize(uint64_t DataSize) 63 | { 64 | // return QLocale{}.formattedDataSize(DataSize, 2, QLocale::DataSizeIecFormat); 65 | 66 | QString ValueStr, UnitStr; 67 | 68 | if (DataSize < Constant::SizeKb) { 69 | ValueStr = QString::number(DataSize); 70 | UnitStr = "B"; 71 | } 72 | else if (DataSize >= Constant::SizeKb && DataSize < Constant::SizeMb) { 73 | ValueStr = QString::number(DataSize / Constant::SizeKb); 74 | UnitStr = "KB"; 75 | } 76 | else if (DataSize >= Constant::SizeMb && DataSize < Constant::SizeGb) { 77 | ValueStr = QString::number((float)DataSize / (float)Constant::SizeMb, 'f', 2); 78 | UnitStr = "MB"; 79 | } 80 | else if (DataSize >= Constant::SizeGb && DataSize < Constant::SizeTb) { 81 | ValueStr = QString::number((float)DataSize / (float)Constant::SizeGb, 'f', 2); 82 | UnitStr = "GB"; 83 | } 84 | else { 85 | ValueStr = QString::number((float)DataSize / (float)Constant::SizeTb, 'f', 2); 86 | UnitStr = "TB"; 87 | } 88 | 89 | return ValueStr + " " + UnitStr; 90 | } 91 | 92 | QString FormatTime(const QDateTime &DateTime) 93 | { 94 | return DateTime.toString(QLocale{}.dateFormat(QLocale::FormatType::ShortFormat)); 95 | } 96 | 97 | } // namespace Text 98 | 99 | namespace File 100 | { 101 | void OpenFolder(const QString &Path) 102 | { 103 | ShellExecuteW(nullptr, nullptr, L"explorer.exe", ("/select,\"" + Path + "\"").toStdWString().c_str(), nullptr, SW_SHOWDEFAULT); 104 | } 105 | 106 | bool MoveToTrash(const QString &File) 107 | { 108 | // Double null termination needed, so can't use QString::utf16 109 | // 110 | QVarLengthArray FromFile(File.length() + 2); 111 | File.toWCharArray(FromFile.data()); 112 | FromFile[File.length()] = wchar_t{}; 113 | FromFile[File.length() + 1] = wchar_t{}; 114 | 115 | SHFILEOPSTRUCTW Operation; 116 | Operation.hwnd = nullptr; 117 | Operation.wFunc = FO_DELETE; 118 | Operation.pFrom = FromFile.constData(); 119 | Operation.pTo = nullptr; 120 | Operation.fFlags = FOF_ALLOWUNDO | FOF_NO_UI; 121 | Operation.fAnyOperationsAborted = false; 122 | Operation.hNameMappings = nullptr; 123 | Operation.lpszProgressTitle = nullptr; 124 | 125 | return SHFileOperationW(&Operation) == 0; 126 | } 127 | 128 | } // namespace File 129 | 130 | namespace Process 131 | { 132 | bool EnumProcesses(const std::function &Callback) 133 | { 134 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 135 | if (hSnapshot == INVALID_HANDLE_VALUE) { 136 | return false; 137 | } 138 | 139 | PROCESSENTRY32W ProcessEntry; 140 | ProcessEntry.dwSize = sizeof(PROCESSENTRY32W); 141 | 142 | if (Process32FirstW(hSnapshot, &ProcessEntry)) 143 | { 144 | do { 145 | InfoT Info; 146 | 147 | Info.Id = ProcessEntry.th32ProcessID; 148 | Info.ParentId = ProcessEntry.th32ParentProcessID; 149 | Info.ThreadsCount = ProcessEntry.cntThreads; 150 | Info.ThreadsBasePriority = ProcessEntry.pcPriClassBase; 151 | Info.Name = QString::fromWCharArray(ProcessEntry.szExeFile); 152 | 153 | if (!Callback(Info)) { 154 | break; 155 | } 156 | 157 | } while (Process32NextW(hSnapshot, &ProcessEntry)); 158 | } 159 | 160 | CloseHandle(hSnapshot); 161 | return true; 162 | } 163 | 164 | } // namespace Process 165 | 166 | namespace System 167 | { 168 | QDateTime SystemTimeToQDateTime(const SYSTEMTIME &Time) 169 | { 170 | return QDateTime{ 171 | QDate{Time.wYear, Time.wMonth, Time.wDay}, 172 | QTime{Time.wHour, Time.wMinute, Time.wSecond} 173 | }; 174 | } 175 | 176 | bool SingleInstance(const QString &InstanceName) 177 | { 178 | HANDLE hMutex = CreateMutexW(nullptr, false, ("Global\\" + InstanceName + "_InstanceMutex").toStdWString().c_str()); 179 | uint32_t LastErrorCode = GetLastError(); 180 | 181 | if (hMutex == NULL) { 182 | FatalError("Create instance mutex failed.\nErrorCode: " + QString::number(LastErrorCode)); 183 | } 184 | 185 | // No need to close the handle 186 | // 187 | return LastErrorCode != ERROR_ALREADY_EXISTS; 188 | } 189 | 190 | } // namespace System 191 | -------------------------------------------------------------------------------- /Source/MainWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ui_MainWindow.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "IEverything.h" 17 | 18 | 19 | namespace UserInterface 20 | { 21 | enum class CheckItemsRuleE : uint32_t 22 | { 23 | ByAccessedDate, // in days 24 | ByDataSize, // in bytes 25 | }; 26 | 27 | enum class ItemsTableColumnE : int 28 | { 29 | CheckBox, 30 | Path, 31 | AccessedDate, 32 | Size, 33 | 34 | _Count 35 | }; 36 | 37 | struct ItemViewDataT 38 | { 39 | bool isChecked; 40 | QString displayAccessedDate; 41 | QString displaySize; 42 | }; 43 | 44 | // Used to draw checkbox in header 45 | // 46 | class CacheItemsHeaderViewT : public QHeaderView 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | explicit CacheItemsHeaderViewT(Qt::Orientation orientation, QWidget *parent = nullptr); 52 | 53 | void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override; 54 | 55 | public Q_SLOTS: 56 | void setCheckBoxDisabled(bool value); 57 | 58 | Q_SIGNALS: 59 | int stateCheckAll() const; 60 | void stateCheckAllChanged(bool value); 61 | 62 | private: 63 | bool _isCheckBoxDisabled = false; 64 | QPair _lastSortIndicator; 65 | 66 | }; 67 | 68 | class CacheItemsDelegateT : public QItemDelegate 69 | { 70 | Q_OBJECT 71 | 72 | public: 73 | using QItemDelegate::QItemDelegate; 74 | 75 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 76 | }; 77 | 78 | class CacheItemsTableModelT : public QAbstractTableModel 79 | { 80 | Q_OBJECT 81 | 82 | public: 83 | using QAbstractTableModel::QAbstractTableModel; 84 | 85 | int rowCount(const QModelIndex &parent = QModelIndex{}) const override; 86 | int columnCount(const QModelIndex &parent = QModelIndex{}) const override; 87 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 88 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; 89 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 90 | Qt::ItemFlags flags(const QModelIndex &index) const; 91 | void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; 92 | 93 | static void sortCacheItems( 94 | QVector> &cacheItems, 95 | ItemsTableColumnE column, 96 | Qt::SortOrder order 97 | ); 98 | 99 | public Q_SLOTS: 100 | QVector> getData(); 101 | void updateData(const QVector &items); 102 | void clearData(); 103 | uint32_t checkByRule(CheckItemsRuleE rule, uint64_t argument); 104 | void checkPart(const QModelIndexList &indexList, bool state); 105 | void checkAll(bool state); 106 | int stateCheckAll() const; 107 | 108 | Q_SIGNALS: 109 | QPair horizontalHeaderSortIndicator(); 110 | 111 | private: 112 | QVector> _cacheItems; 113 | int _checkedCount = 0; 114 | int _stateCheckAll = Qt::Unchecked; 115 | 116 | void updateCheckAllState(bool updateState, int updateCount = 1); 117 | void resetCheckAllState(); 118 | }; 119 | 120 | // Rc = Right-click 121 | // 122 | class CacheItemsRcMenuT : public QMenu 123 | { 124 | Q_OBJECT 125 | 126 | public: 127 | CacheItemsRcMenuT(QWidget *parent = nullptr); 128 | 129 | Q_SIGNALS: 130 | QItemSelectionModel *itemsSelectionModel() const; 131 | 132 | public Q_SLOTS: 133 | void menuRequested(const QPoint &pos); 134 | 135 | private: 136 | enum class ActionIdE : uint32_t 137 | { 138 | OpenFolder, 139 | CheckSelected, 140 | UncheckSelected, 141 | CopyPath, 142 | }; 143 | 144 | QAction *_openFolderAction; 145 | QAction *_copyPathAction; 146 | QAction *_checkSelectedAction; 147 | QAction *_uncheckSelectedAction; 148 | 149 | template 150 | QAction* addCommonAction(ArgsT &&...args) 151 | { 152 | QAction *action = addAction(std::forward(args)...); 153 | parentWidget()->addAction(action); 154 | return action; 155 | } 156 | 157 | void connectCommonAction(QAction *action, ActionIdE actionId); 158 | 159 | private Q_SLOTS: 160 | void commonActionClicked(ActionIdE actionId); 161 | 162 | }; 163 | 164 | class MainWindowT : public QMainWindow 165 | { 166 | Q_OBJECT 167 | 168 | public: 169 | enum class StatusTypeE : uint32_t 170 | { 171 | Info, 172 | Warning, 173 | Error 174 | }; 175 | 176 | MainWindowT(QWidget *parent = Q_NULLPTR); 177 | ~MainWindowT(); 178 | 179 | Q_SIGNALS: 180 | void setControlsDisabledSafety(bool isDisable); 181 | void showStatusMessageSafety(StatusTypeE statusType, const QString &text); 182 | QPair horizontalHeaderSortIndicatorSafety(); 183 | QString getPathTextSafety(); 184 | QVector> getDataSafety(); 185 | void updateDataSafety(const QVector &items); 186 | void updateDiskStatsChartSafety(quint64 cache); 187 | void clearDataSafety(); 188 | 189 | private: 190 | enum class HelpActionIdE : uint32_t 191 | { 192 | ReportIssue, 193 | CheckUpdate, 194 | About 195 | }; 196 | 197 | Ui::VsCacheCleanerClass _ui; 198 | QAction *_pathClearAction; 199 | QLabel *_statusLabelType, *_statusLabelText; 200 | CacheItemsRcMenuT *_cacheItemsRcMenu; 201 | QBarSet *_barSetCache, *_barSetOther, *_barSetFree; 202 | 203 | std::future _taskFuture; 204 | std::thread _observeThread; 205 | 206 | void DetectVsRunning(); 207 | CacheItemsTableModelT* getCacheItemsTableModel(); 208 | void setControlsDisabled(bool value); 209 | void initializeMenuActions(); 210 | void asyncTask(std::function task, std::function observer = std::function{}); 211 | void waitForEtInitialized(); 212 | void showStatusMessage(StatusTypeE statusType, const QString &text); 213 | void updateDiskStatsChart(quint64 cache); 214 | void resetDiskStatsChart(); 215 | void clearData(); 216 | void showReady(); 217 | 218 | private Q_SLOTS: 219 | void selectButtonClicked(); 220 | void scanButtonClicked(); 221 | void deleteButtonClicked(); 222 | void helpMenuActionClicked(HelpActionIdE actionId); 223 | 224 | }; 225 | 226 | } // namespace UserInterface 227 | -------------------------------------------------------------------------------- /Source/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | VsCacheCleanerClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 600 11 | 12 | 13 | 14 | VsCacheCleaner 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Path: 24 | 25 | 26 | 27 | 28 | 29 | 30 | Qt::NoFocus 31 | 32 | 33 | true 34 | 35 | 36 | If empty, all disks will be scanned 37 | 38 | 39 | true 40 | 41 | 42 | 43 | 44 | 45 | 46 | Select 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | QAbstractItemView::SelectRows 58 | 59 | 60 | true 61 | 62 | 63 | false 64 | 65 | 66 | false 67 | 68 | 69 | false 70 | 71 | 72 | 20 73 | 74 | 75 | 20 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Scan 85 | 86 | 87 | 88 | 89 | 90 | 91 | Delete 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 0 105 | 0 106 | 500 107 | 23 108 | 109 | 110 | 111 | 112 | Rule 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | Help 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | Check items accessed 7 days ago 142 | 143 | 144 | 145 | 146 | Check items accessed 1 month ago 147 | 148 | 149 | 150 | 151 | Check items accessed 3 months ago 152 | 153 | 154 | 155 | 156 | Check items accessed 6 months ago 157 | 158 | 159 | 160 | 161 | Check items accessed 1 year ago 162 | 163 | 164 | 165 | 166 | Report issue... 167 | 168 | 169 | 170 | 171 | Check update... 172 | 173 | 174 | 175 | 176 | About 177 | 178 | 179 | 180 | 181 | Check items greater than 50 MB in size 182 | 183 | 184 | 185 | 186 | Check items greater than 100 MB in size 187 | 188 | 189 | 190 | 191 | Check items greater than 500 MB in size 192 | 193 | 194 | 195 | 196 | Check items greater than 1 GB in size 197 | 198 | 199 | 200 | 201 | Check items greater than 3 GB in size 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # JustCode is a .NET coding add-in 131 | .JustCode 132 | 133 | # TeamCity is a build add-in 134 | _TeamCity* 135 | 136 | # DotCover is a Code Coverage Tool 137 | *.dotCover 138 | 139 | # AxoCover is a Code Coverage Tool 140 | .axoCover/* 141 | !.axoCover/settings.json 142 | 143 | # Visual Studio code coverage results 144 | *.coverage 145 | *.coveragexml 146 | 147 | # NCrunch 148 | _NCrunch_* 149 | .*crunch*.local.xml 150 | nCrunchTemp_* 151 | 152 | # MightyMoose 153 | *.mm.* 154 | AutoTest.Net/ 155 | 156 | # Web workbench (sass) 157 | .sass-cache/ 158 | 159 | # Installshield output folder 160 | [Ee]xpress/ 161 | 162 | # DocProject is a documentation generator add-in 163 | DocProject/buildhelp/ 164 | DocProject/Help/*.HxT 165 | DocProject/Help/*.HxC 166 | DocProject/Help/*.hhc 167 | DocProject/Help/*.hhk 168 | DocProject/Help/*.hhp 169 | DocProject/Help/Html2 170 | DocProject/Help/html 171 | 172 | # Click-Once directory 173 | publish/ 174 | 175 | # Publish Web Output 176 | *.[Pp]ublish.xml 177 | *.azurePubxml 178 | # Note: Comment the next line if you want to checkin your web deploy settings, 179 | # but database connection strings (with potential passwords) will be unencrypted 180 | *.pubxml 181 | *.publishproj 182 | 183 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 184 | # checkin your Azure Web App publish settings, but sensitive information contained 185 | # in these scripts will be unencrypted 186 | PublishScripts/ 187 | 188 | # NuGet Packages 189 | *.nupkg 190 | # NuGet Symbol Packages 191 | *.snupkg 192 | # The packages folder can be ignored because of Package Restore 193 | **/[Pp]ackages/* 194 | # except build/, which is used as an MSBuild target. 195 | !**/[Pp]ackages/build/ 196 | # Uncomment if necessary however generally it will be regenerated when needed 197 | #!**/[Pp]ackages/repositories.config 198 | # NuGet v3's project.json files produces more ignorable files 199 | *.nuget.props 200 | *.nuget.targets 201 | 202 | # Microsoft Azure Build Output 203 | csx/ 204 | *.build.csdef 205 | 206 | # Microsoft Azure Emulator 207 | ecf/ 208 | rcf/ 209 | 210 | # Windows Store app package directories and files 211 | AppPackages/ 212 | BundleArtifacts/ 213 | Package.StoreAssociation.xml 214 | _pkginfo.txt 215 | *.appx 216 | *.appxbundle 217 | *.appxupload 218 | 219 | # Visual Studio cache files 220 | # files ending in .cache can be ignored 221 | *.[Cc]ache 222 | # but keep track of directories ending in .cache 223 | !?*.[Cc]ache/ 224 | 225 | # Others 226 | ClientBin/ 227 | ~$* 228 | *~ 229 | *.dbmdl 230 | *.dbproj.schemaview 231 | *.jfm 232 | *.pfx 233 | *.publishsettings 234 | orleans.codegen.cs 235 | 236 | # Including strong name files can present a security risk 237 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 238 | #*.snk 239 | 240 | # Since there are multiple workflows, uncomment next line to ignore bower_components 241 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 242 | #bower_components/ 243 | 244 | # RIA/Silverlight projects 245 | Generated_Code/ 246 | 247 | # Backup & report files from converting an old project file 248 | # to a newer Visual Studio version. Backup files are not needed, 249 | # because we have git ;-) 250 | _UpgradeReport_Files/ 251 | Backup*/ 252 | UpgradeLog*.XML 253 | UpgradeLog*.htm 254 | ServiceFabricBackup/ 255 | *.rptproj.bak 256 | 257 | # SQL Server files 258 | *.mdf 259 | *.ldf 260 | *.ndf 261 | 262 | # Business Intelligence projects 263 | *.rdl.data 264 | *.bim.layout 265 | *.bim_*.settings 266 | *.rptproj.rsuser 267 | *- [Bb]ackup.rdl 268 | *- [Bb]ackup ([0-9]).rdl 269 | *- [Bb]ackup ([0-9][0-9]).rdl 270 | 271 | # Microsoft Fakes 272 | FakesAssemblies/ 273 | 274 | # GhostDoc plugin setting file 275 | *.GhostDoc.xml 276 | 277 | # Node.js Tools for Visual Studio 278 | .ntvs_analysis.dat 279 | node_modules/ 280 | 281 | # Visual Studio 6 build log 282 | *.plg 283 | 284 | # Visual Studio 6 workspace options file 285 | *.opt 286 | 287 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 288 | *.vbw 289 | 290 | # Visual Studio LightSwitch build output 291 | **/*.HTMLClient/GeneratedArtifacts 292 | **/*.DesktopClient/GeneratedArtifacts 293 | **/*.DesktopClient/ModelManifest.xml 294 | **/*.Server/GeneratedArtifacts 295 | **/*.Server/ModelManifest.xml 296 | _Pvt_Extensions 297 | 298 | # Paket dependency manager 299 | .paket/paket.exe 300 | paket-files/ 301 | 302 | # FAKE - F# Make 303 | .fake/ 304 | 305 | # CodeRush personal settings 306 | .cr/personal 307 | 308 | # Python Tools for Visual Studio (PTVS) 309 | __pycache__/ 310 | *.pyc 311 | 312 | # Cake - Uncomment if you are using it 313 | # tools/** 314 | # !tools/packages.config 315 | 316 | # Tabs Studio 317 | *.tss 318 | 319 | # Telerik's JustMock configuration file 320 | *.jmconfig 321 | 322 | # BizTalk build output 323 | *.btp.cs 324 | *.btm.cs 325 | *.odx.cs 326 | *.xsd.cs 327 | 328 | # OpenCover UI analysis results 329 | OpenCover/ 330 | 331 | # Azure Stream Analytics local run output 332 | ASALocalRun/ 333 | 334 | # MSBuild Binary and Structured Log 335 | *.binlog 336 | 337 | # NVidia Nsight GPU debugger configuration file 338 | *.nvuser 339 | 340 | # MFractors (Xamarin productivity tool) working folder 341 | .mfractor/ 342 | 343 | # Local History for Visual Studio 344 | .localhistory/ 345 | 346 | # BeatPulse healthcheck temp database 347 | healthchecksdb 348 | 349 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 350 | MigrationBackup/ 351 | 352 | # Ionide (cross platform F# VS Code tools) working folder 353 | .ionide/ 354 | 355 | # Custom 356 | Binary/ 357 | *.qm 358 | -------------------------------------------------------------------------------- /Source/ThirdParty/MinHook/include/MinHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__) 32 | #error MinHook supports only x86 and x64 systems. 33 | #endif 34 | 35 | #include 36 | 37 | // MinHook Error Codes. 38 | typedef enum MH_STATUS 39 | { 40 | // Unknown error. Should not be returned. 41 | MH_UNKNOWN = -1, 42 | 43 | // Successful. 44 | MH_OK = 0, 45 | 46 | // MinHook is already initialized. 47 | MH_ERROR_ALREADY_INITIALIZED, 48 | 49 | // MinHook is not initialized yet, or already uninitialized. 50 | MH_ERROR_NOT_INITIALIZED, 51 | 52 | // The hook for the specified target function is already created. 53 | MH_ERROR_ALREADY_CREATED, 54 | 55 | // The hook for the specified target function is not created yet. 56 | MH_ERROR_NOT_CREATED, 57 | 58 | // The hook for the specified target function is already enabled. 59 | MH_ERROR_ENABLED, 60 | 61 | // The hook for the specified target function is not enabled yet, or already 62 | // disabled. 63 | MH_ERROR_DISABLED, 64 | 65 | // The specified pointer is invalid. It points the address of non-allocated 66 | // and/or non-executable region. 67 | MH_ERROR_NOT_EXECUTABLE, 68 | 69 | // The specified target function cannot be hooked. 70 | MH_ERROR_UNSUPPORTED_FUNCTION, 71 | 72 | // Failed to allocate memory. 73 | MH_ERROR_MEMORY_ALLOC, 74 | 75 | // Failed to change the memory protection. 76 | MH_ERROR_MEMORY_PROTECT, 77 | 78 | // The specified module is not loaded. 79 | MH_ERROR_MODULE_NOT_FOUND, 80 | 81 | // The specified function is not found. 82 | MH_ERROR_FUNCTION_NOT_FOUND 83 | } 84 | MH_STATUS; 85 | 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook, 87 | // MH_QueueEnableHook or MH_QueueDisableHook. 88 | #define MH_ALL_HOOKS NULL 89 | 90 | #ifdef __cplusplus 91 | extern "C" { 92 | #endif 93 | 94 | // Initialize the MinHook library. You must call this function EXACTLY ONCE 95 | // at the beginning of your program. 96 | MH_STATUS WINAPI MH_Initialize(VOID); 97 | 98 | // Uninitialize the MinHook library. You must call this function EXACTLY 99 | // ONCE at the end of your program. 100 | MH_STATUS WINAPI MH_Uninitialize(VOID); 101 | 102 | // Creates a Hook for the specified target function, in disabled state. 103 | // Parameters: 104 | // pTarget [in] A pointer to the target function, which will be 105 | // overridden by the detour function. 106 | // pDetour [in] A pointer to the detour function, which will override 107 | // the target function. 108 | // ppOriginal [out] A pointer to the trampoline function, which will be 109 | // used to call the original target function. 110 | // This parameter can be NULL. 111 | MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); 112 | 113 | // Creates a Hook for the specified API function, in disabled state. 114 | // Parameters: 115 | // pszModule [in] A pointer to the loaded module name which contains the 116 | // target function. 117 | // pszTarget [in] A pointer to the target function name, which will be 118 | // overridden by the detour function. 119 | // pDetour [in] A pointer to the detour function, which will override 120 | // the target function. 121 | // ppOriginal [out] A pointer to the trampoline function, which will be 122 | // used to call the original target function. 123 | // This parameter can be NULL. 124 | MH_STATUS WINAPI MH_CreateHookApi( 125 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); 126 | 127 | // Creates a Hook for the specified API function, in disabled state. 128 | // Parameters: 129 | // pszModule [in] A pointer to the loaded module name which contains the 130 | // target function. 131 | // pszTarget [in] A pointer to the target function name, which will be 132 | // overridden by the detour function. 133 | // pDetour [in] A pointer to the detour function, which will override 134 | // the target function. 135 | // ppOriginal [out] A pointer to the trampoline function, which will be 136 | // used to call the original target function. 137 | // This parameter can be NULL. 138 | // ppTarget [out] A pointer to the target function, which will be used 139 | // with other functions. 140 | // This parameter can be NULL. 141 | MH_STATUS WINAPI MH_CreateHookApiEx( 142 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget); 143 | 144 | // Removes an already created hook. 145 | // Parameters: 146 | // pTarget [in] A pointer to the target function. 147 | MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); 148 | 149 | // Enables an already created hook. 150 | // Parameters: 151 | // pTarget [in] A pointer to the target function. 152 | // If this parameter is MH_ALL_HOOKS, all created hooks are 153 | // enabled in one go. 154 | MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); 155 | 156 | // Disables an already created hook. 157 | // Parameters: 158 | // pTarget [in] A pointer to the target function. 159 | // If this parameter is MH_ALL_HOOKS, all created hooks are 160 | // disabled in one go. 161 | MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); 162 | 163 | // Queues to enable an already created hook. 164 | // Parameters: 165 | // pTarget [in] A pointer to the target function. 166 | // If this parameter is MH_ALL_HOOKS, all created hooks are 167 | // queued to be enabled. 168 | MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); 169 | 170 | // Queues to disable an already created hook. 171 | // Parameters: 172 | // pTarget [in] A pointer to the target function. 173 | // If this parameter is MH_ALL_HOOKS, all created hooks are 174 | // queued to be disabled. 175 | MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); 176 | 177 | // Applies all queued changes in one go. 178 | MH_STATUS WINAPI MH_ApplyQueued(VOID); 179 | 180 | // Translates the MH_STATUS to its name as a string. 181 | const char * WINAPI MH_StatusToString(MH_STATUS status); 182 | 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | 187 | -------------------------------------------------------------------------------- /Build/VsCacheCleaner.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | {D111AB45-333B-463B-BC30-813DA8AFA933} 47 | QtVS_v303 48 | 10.0 49 | 10.0 50 | $(MSBuildProjectDirectory)\QtMsBuild 51 | 52 | 53 | 54 | Application 55 | v142 56 | 57 | 58 | Application 59 | v142 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | $(SolutionDir)Binary\$(Configuration)\ 79 | $(ProjectDir)..\Source\ThirdParty\Everything-SDK\lib;$(ProjectDir)..\Source\ThirdParty\MinHook\lib;$(LibraryPath) 80 | 81 | 82 | $(SolutionDir)Binary\$(Configuration)\ 83 | $(ProjectDir)..\Source\ThirdParty\Everything-SDK\lib;$(ProjectDir)..\Source\ThirdParty\MinHook\lib;$(LibraryPath) 84 | 85 | 86 | 87 | $(ProjectDir)..\Source\ThirdParty\Everything-SDK\include;$(ProjectDir)..\Source\ThirdParty\MinHook\include;%(AdditionalIncludeDirectories) 88 | stdcpp17 89 | Level3 90 | 91 | 92 | copy /v "$(ProjectDir)..\Source\ThirdParty\Everything-SDK\dll\Everything32.dll" "$(OutDir)" 93 | copy /v "$(ProjectDir)..\Source\ThirdParty\MinHook\dll\MinHook.x86.dll" "$(OutDir)" 94 | mkdir "$(OutDir)Everything" 95 | xcopy "$(ProjectDir)..\Resource\Everything" "$(OutDir)Everything" /s /v /q 96 | xcopy "$(ProjectDir)..\Resource\Translations\*.qm" "$(OutDir)translations" /s /v /q 97 | 98 | 99 | rmdir /s /q "$(OutDir)" 100 | 101 | 102 | RequireAdministrator 103 | 104 | 105 | 106 | 107 | $(ProjectDir)..\Source\ThirdParty\Everything-SDK\include;$(ProjectDir)..\Source\ThirdParty\MinHook\include;%(AdditionalIncludeDirectories) 108 | stdcpp17 109 | Level3 110 | 111 | 112 | copy /v "$(ProjectDir)..\Source\ThirdParty\Everything-SDK\dll\Everything32.dll" "$(OutDir)" 113 | copy /v "$(ProjectDir)..\Source\ThirdParty\MinHook\dll\MinHook.x86.dll" "$(OutDir)" 114 | mkdir "$(OutDir)Everything" 115 | xcopy "$(ProjectDir)..\Resource\Everything" "$(OutDir)Everything" /s /v /q 116 | xcopy "$(ProjectDir)..\Resource\Translations\*.qm" "$(OutDir)translations" /s /v /q 117 | 118 | 119 | rmdir /s /q "$(OutDir)" 120 | 121 | 122 | RequireAdministrator 123 | 124 | 125 | 126 | msvc2017 127 | charts;core;gui;widgets 128 | debug 129 | true 130 | 131 | 132 | msvc2017 133 | charts;core;gui;widgets 134 | release 135 | true 136 | 137 | 138 | 139 | 140 | 141 | 142 | true 143 | true 144 | ProgramDatabase 145 | Disabled 146 | MultiThreadedDebugDLL 147 | 148 | 149 | Windows 150 | true 151 | 152 | 153 | 154 | 155 | true 156 | true 157 | None 158 | MaxSpeed 159 | MultiThreadedDLL 160 | 161 | 162 | Windows 163 | false 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharpx64/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace WindowsApplication1 11 | { 12 | public partial class Form1 : Form 13 | { 14 | const int EVERYTHING_OK = 0; 15 | const int EVERYTHING_ERROR_MEMORY = 1; 16 | const int EVERYTHING_ERROR_IPC = 2; 17 | const int EVERYTHING_ERROR_REGISTERCLASSEX = 3; 18 | const int EVERYTHING_ERROR_CREATEWINDOW = 4; 19 | const int EVERYTHING_ERROR_CREATETHREAD = 5; 20 | const int EVERYTHING_ERROR_INVALIDINDEX = 6; 21 | const int EVERYTHING_ERROR_INVALIDCALL = 7; 22 | 23 | const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001; 24 | const int EVERYTHING_REQUEST_PATH = 0x00000002; 25 | const int EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = 0x00000004; 26 | const int EVERYTHING_REQUEST_EXTENSION = 0x00000008; 27 | const int EVERYTHING_REQUEST_SIZE = 0x00000010; 28 | const int EVERYTHING_REQUEST_DATE_CREATED = 0x00000020; 29 | const int EVERYTHING_REQUEST_DATE_MODIFIED = 0x00000040; 30 | const int EVERYTHING_REQUEST_DATE_ACCESSED = 0x00000080; 31 | const int EVERYTHING_REQUEST_ATTRIBUTES = 0x00000100; 32 | const int EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = 0x00000200; 33 | const int EVERYTHING_REQUEST_RUN_COUNT = 0x00000400; 34 | const int EVERYTHING_REQUEST_DATE_RUN = 0x00000800; 35 | const int EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = 0x00001000; 36 | const int EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = 0x00002000; 37 | const int EVERYTHING_REQUEST_HIGHLIGHTED_PATH = 0x00004000; 38 | const int EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = 0x00008000; 39 | 40 | const int EVERYTHING_SORT_NAME_ASCENDING = 1; 41 | const int EVERYTHING_SORT_NAME_DESCENDING = 2; 42 | const int EVERYTHING_SORT_PATH_ASCENDING = 3; 43 | const int EVERYTHING_SORT_PATH_DESCENDING = 4; 44 | const int EVERYTHING_SORT_SIZE_ASCENDING = 5; 45 | const int EVERYTHING_SORT_SIZE_DESCENDING = 6; 46 | const int EVERYTHING_SORT_EXTENSION_ASCENDING = 7; 47 | const int EVERYTHING_SORT_EXTENSION_DESCENDING = 8; 48 | const int EVERYTHING_SORT_TYPE_NAME_ASCENDING = 9; 49 | const int EVERYTHING_SORT_TYPE_NAME_DESCENDING = 10; 50 | const int EVERYTHING_SORT_DATE_CREATED_ASCENDING = 11; 51 | const int EVERYTHING_SORT_DATE_CREATED_DESCENDING = 12; 52 | const int EVERYTHING_SORT_DATE_MODIFIED_ASCENDING = 13; 53 | const int EVERYTHING_SORT_DATE_MODIFIED_DESCENDING = 14; 54 | const int EVERYTHING_SORT_ATTRIBUTES_ASCENDING = 15; 55 | const int EVERYTHING_SORT_ATTRIBUTES_DESCENDING = 16; 56 | const int EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING = 17; 57 | const int EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING = 18; 58 | const int EVERYTHING_SORT_RUN_COUNT_ASCENDING = 19; 59 | const int EVERYTHING_SORT_RUN_COUNT_DESCENDING = 20; 60 | const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING = 21; 61 | const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING = 22; 62 | const int EVERYTHING_SORT_DATE_ACCESSED_ASCENDING = 23; 63 | const int EVERYTHING_SORT_DATE_ACCESSED_DESCENDING = 24; 64 | const int EVERYTHING_SORT_DATE_RUN_ASCENDING = 25; 65 | const int EVERYTHING_SORT_DATE_RUN_DESCENDING = 26; 66 | 67 | const int EVERYTHING_TARGET_MACHINE_X86 = 1; 68 | const int EVERYTHING_TARGET_MACHINE_X64 = 2; 69 | const int EVERYTHING_TARGET_MACHINE_ARM = 3; 70 | 71 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 72 | public static extern UInt32 Everything_SetSearchW(string lpSearchString); 73 | [DllImport("Everything64.dll")] 74 | public static extern void Everything_SetMatchPath(bool bEnable); 75 | [DllImport("Everything64.dll")] 76 | public static extern void Everything_SetMatchCase(bool bEnable); 77 | [DllImport("Everything64.dll")] 78 | public static extern void Everything_SetMatchWholeWord(bool bEnable); 79 | [DllImport("Everything64.dll")] 80 | public static extern void Everything_SetRegex(bool bEnable); 81 | [DllImport("Everything64.dll")] 82 | public static extern void Everything_SetMax(UInt32 dwMax); 83 | [DllImport("Everything64.dll")] 84 | public static extern void Everything_SetOffset(UInt32 dwOffset); 85 | 86 | [DllImport("Everything64.dll")] 87 | public static extern bool Everything_GetMatchPath(); 88 | [DllImport("Everything64.dll")] 89 | public static extern bool Everything_GetMatchCase(); 90 | [DllImport("Everything64.dll")] 91 | public static extern bool Everything_GetMatchWholeWord(); 92 | [DllImport("Everything64.dll")] 93 | public static extern bool Everything_GetRegex(); 94 | [DllImport("Everything64.dll")] 95 | public static extern UInt32 Everything_GetMax(); 96 | [DllImport("Everything64.dll")] 97 | public static extern UInt32 Everything_GetOffset(); 98 | [DllImport("Everything64.dll")] 99 | public static extern IntPtr Everything_GetSearchW(); 100 | [DllImport("Everything64.dll")] 101 | public static extern UInt32 Everything_GetLastError(); 102 | 103 | [DllImport("Everything64.dll")] 104 | public static extern bool Everything_QueryW(bool bWait); 105 | 106 | [DllImport("Everything64.dll")] 107 | public static extern void Everything_SortResultsByPath(); 108 | 109 | [DllImport("Everything64.dll")] 110 | public static extern UInt32 Everything_GetNumFileResults(); 111 | [DllImport("Everything64.dll")] 112 | public static extern UInt32 Everything_GetNumFolderResults(); 113 | [DllImport("Everything64.dll")] 114 | public static extern UInt32 Everything_GetNumResults(); 115 | [DllImport("Everything64.dll")] 116 | public static extern UInt32 Everything_GetTotFileResults(); 117 | [DllImport("Everything64.dll")] 118 | public static extern UInt32 Everything_GetTotFolderResults(); 119 | [DllImport("Everything64.dll")] 120 | public static extern UInt32 Everything_GetTotResults(); 121 | [DllImport("Everything64.dll")] 122 | public static extern bool Everything_IsVolumeResult(UInt32 nIndex); 123 | [DllImport("Everything64.dll")] 124 | public static extern bool Everything_IsFolderResult(UInt32 nIndex); 125 | [DllImport("Everything64.dll")] 126 | public static extern bool Everything_IsFileResult(UInt32 nIndex); 127 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 128 | public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount); 129 | [DllImport("Everything64.dll")] 130 | public static extern void Everything_Reset(); 131 | 132 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 133 | public static extern IntPtr Everything_GetResultFileName(UInt32 nIndex); 134 | 135 | // Everything 1.4 136 | [DllImport("Everything64.dll")] 137 | public static extern void Everything_SetSort(UInt32 dwSortType); 138 | [DllImport("Everything64.dll")] 139 | public static extern UInt32 Everything_GetSort(); 140 | [DllImport("Everything64.dll")] 141 | public static extern UInt32 Everything_GetResultListSort(); 142 | [DllImport("Everything64.dll")] 143 | public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags); 144 | [DllImport("Everything64.dll")] 145 | public static extern UInt32 Everything_GetRequestFlags(); 146 | [DllImport("Everything64.dll")] 147 | public static extern UInt32 Everything_GetResultListRequestFlags(); 148 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 149 | public static extern IntPtr Everything_GetResultExtension(UInt32 nIndex); 150 | [DllImport("Everything64.dll")] 151 | public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize); 152 | [DllImport("Everything64.dll")] 153 | public static extern bool Everything_GetResultDateCreated(UInt32 nIndex, out long lpFileTime); 154 | [DllImport("Everything64.dll")] 155 | public static extern bool Everything_GetResultDateModified(UInt32 nIndex, out long lpFileTime); 156 | [DllImport("Everything64.dll")] 157 | public static extern bool Everything_GetResultDateAccessed(UInt32 nIndex, out long lpFileTime); 158 | [DllImport("Everything64.dll")] 159 | public static extern UInt32 Everything_GetResultAttributes(UInt32 nIndex); 160 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 161 | public static extern IntPtr Everything_GetResultFileListFileName(UInt32 nIndex); 162 | [DllImport("Everything64.dll")] 163 | public static extern UInt32 Everything_GetResultRunCount(UInt32 nIndex); 164 | [DllImport("Everything64.dll")] 165 | public static extern bool Everything_GetResultDateRun(UInt32 nIndex, out long lpFileTime); 166 | [DllImport("Everything64.dll")] 167 | public static extern bool Everything_GetResultDateRecentlyChanged(UInt32 nIndex, out long lpFileTime); 168 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 169 | public static extern IntPtr Everything_GetResultHighlightedFileName(UInt32 nIndex); 170 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 171 | public static extern IntPtr Everything_GetResultHighlightedPath(UInt32 nIndex); 172 | [DllImport("Everything64.dll", CharSet = CharSet.Unicode)] 173 | public static extern IntPtr Everything_GetResultHighlightedFullPathAndFileName(UInt32 nIndex); 174 | [DllImport("Everything64.dll")] 175 | public static extern UInt32 Everything_GetRunCountFromFileName(string lpFileName); 176 | [DllImport("Everything64.dll")] 177 | public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount); 178 | [DllImport("Everything64.dll")] 179 | public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName); 180 | 181 | public Form1() 182 | { 183 | InitializeComponent(); 184 | } 185 | 186 | private void button1_Click(object sender, EventArgs e) 187 | { 188 | UInt32 i; 189 | 190 | // set the search 191 | Everything_SetSearchW(textBox1.Text); 192 | 193 | // use our own custom scrollbar... 194 | // Everything_SetMax(listBox1.ClientRectangle.Height / listBox1.ItemHeight); 195 | // Everything_SetOffset(VerticalScrollBarPosition...); 196 | 197 | // request name and size 198 | Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_DATE_MODIFIED | EVERYTHING_REQUEST_SIZE); 199 | 200 | Everything_SetSort(13); 201 | 202 | // execute the query 203 | Everything_QueryW(true); 204 | 205 | // sort by path 206 | // Everything_SortResultsByPath(); 207 | 208 | // clear the old list of results 209 | listBox1.Items.Clear(); 210 | 211 | // set the window title 212 | Text = textBox1.Text + " - " + Everything_GetNumResults() + " Results"; 213 | 214 | // loop through the results, adding each result to the listbox. 215 | for (i = 0; i < Everything_GetNumResults(); i++) 216 | { 217 | long date_modified; 218 | long size; 219 | 220 | Everything_GetResultDateModified(i, out date_modified); 221 | Everything_GetResultSize(i, out size); 222 | 223 | // add it to the list box 224 | listBox1.Items.Insert((int)i, "Size: " + size.ToString() + " Date Modified: " + DateTime.FromFileTime(date_modified).Year + "/" + DateTime.FromFileTime(date_modified).Month + "/" + DateTime.FromFileTime(date_modified).Day + " " + DateTime.FromFileTime(date_modified).Hour + ":" + DateTime.FromFileTime(date_modified).Minute.ToString("D2") + " Filename: " + Marshal.PtrToStringUni(Everything_GetResultFileName(i))); 225 | } 226 | } 227 | } 228 | } -------------------------------------------------------------------------------- /Source/ThirdParty/Everything-SDK/example/CSharp/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace WindowsApplication1 11 | { 12 | public partial class Form1 : Form 13 | { 14 | const int EVERYTHING_OK = 0; 15 | const int EVERYTHING_ERROR_MEMORY = 1; 16 | const int EVERYTHING_ERROR_IPC = 2; 17 | const int EVERYTHING_ERROR_REGISTERCLASSEX = 3; 18 | const int EVERYTHING_ERROR_CREATEWINDOW = 4; 19 | const int EVERYTHING_ERROR_CREATETHREAD = 5; 20 | const int EVERYTHING_ERROR_INVALIDINDEX = 6; 21 | const int EVERYTHING_ERROR_INVALIDCALL = 7; 22 | 23 | const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001; 24 | const int EVERYTHING_REQUEST_PATH = 0x00000002; 25 | const int EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = 0x00000004; 26 | const int EVERYTHING_REQUEST_EXTENSION = 0x00000008; 27 | const int EVERYTHING_REQUEST_SIZE = 0x00000010; 28 | const int EVERYTHING_REQUEST_DATE_CREATED = 0x00000020; 29 | const int EVERYTHING_REQUEST_DATE_MODIFIED = 0x00000040; 30 | const int EVERYTHING_REQUEST_DATE_ACCESSED = 0x00000080; 31 | const int EVERYTHING_REQUEST_ATTRIBUTES = 0x00000100; 32 | const int EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = 0x00000200; 33 | const int EVERYTHING_REQUEST_RUN_COUNT = 0x00000400; 34 | const int EVERYTHING_REQUEST_DATE_RUN = 0x00000800; 35 | const int EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = 0x00001000; 36 | const int EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = 0x00002000; 37 | const int EVERYTHING_REQUEST_HIGHLIGHTED_PATH = 0x00004000; 38 | const int EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = 0x00008000; 39 | 40 | const int EVERYTHING_SORT_NAME_ASCENDING = 1; 41 | const int EVERYTHING_SORT_NAME_DESCENDING = 2; 42 | const int EVERYTHING_SORT_PATH_ASCENDING = 3; 43 | const int EVERYTHING_SORT_PATH_DESCENDING = 4; 44 | const int EVERYTHING_SORT_SIZE_ASCENDING = 5; 45 | const int EVERYTHING_SORT_SIZE_DESCENDING = 6; 46 | const int EVERYTHING_SORT_EXTENSION_ASCENDING = 7; 47 | const int EVERYTHING_SORT_EXTENSION_DESCENDING = 8; 48 | const int EVERYTHING_SORT_TYPE_NAME_ASCENDING = 9; 49 | const int EVERYTHING_SORT_TYPE_NAME_DESCENDING = 10; 50 | const int EVERYTHING_SORT_DATE_CREATED_ASCENDING = 11; 51 | const int EVERYTHING_SORT_DATE_CREATED_DESCENDING = 12; 52 | const int EVERYTHING_SORT_DATE_MODIFIED_ASCENDING = 13; 53 | const int EVERYTHING_SORT_DATE_MODIFIED_DESCENDING = 14; 54 | const int EVERYTHING_SORT_ATTRIBUTES_ASCENDING = 15; 55 | const int EVERYTHING_SORT_ATTRIBUTES_DESCENDING = 16; 56 | const int EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING = 17; 57 | const int EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING = 18; 58 | const int EVERYTHING_SORT_RUN_COUNT_ASCENDING = 19; 59 | const int EVERYTHING_SORT_RUN_COUNT_DESCENDING = 20; 60 | const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING = 21; 61 | const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING = 22; 62 | const int EVERYTHING_SORT_DATE_ACCESSED_ASCENDING = 23; 63 | const int EVERYTHING_SORT_DATE_ACCESSED_DESCENDING= 24; 64 | const int EVERYTHING_SORT_DATE_RUN_ASCENDING = 25; 65 | const int EVERYTHING_SORT_DATE_RUN_DESCENDING = 26; 66 | 67 | const int EVERYTHING_TARGET_MACHINE_X86 = 1; 68 | const int EVERYTHING_TARGET_MACHINE_X64 = 2; 69 | const int EVERYTHING_TARGET_MACHINE_ARM = 3; 70 | 71 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 72 | public static extern UInt32 Everything_SetSearchW(string lpSearchString); 73 | [DllImport("Everything32.dll")] 74 | public static extern void Everything_SetMatchPath(bool bEnable); 75 | [DllImport("Everything32.dll")] 76 | public static extern void Everything_SetMatchCase(bool bEnable); 77 | [DllImport("Everything32.dll")] 78 | public static extern void Everything_SetMatchWholeWord(bool bEnable); 79 | [DllImport("Everything32.dll")] 80 | public static extern void Everything_SetRegex(bool bEnable); 81 | [DllImport("Everything32.dll")] 82 | public static extern void Everything_SetMax(UInt32 dwMax); 83 | [DllImport("Everything32.dll")] 84 | public static extern void Everything_SetOffset(UInt32 dwOffset); 85 | 86 | [DllImport("Everything32.dll")] 87 | public static extern bool Everything_GetMatchPath(); 88 | [DllImport("Everything32.dll")] 89 | public static extern bool Everything_GetMatchCase(); 90 | [DllImport("Everything32.dll")] 91 | public static extern bool Everything_GetMatchWholeWord(); 92 | [DllImport("Everything32.dll")] 93 | public static extern bool Everything_GetRegex(); 94 | [DllImport("Everything32.dll")] 95 | public static extern UInt32 Everything_GetMax(); 96 | [DllImport("Everything32.dll")] 97 | public static extern UInt32 Everything_GetOffset(); 98 | [DllImport("Everything32.dll")] 99 | public static extern IntPtr Everything_GetSearchW(); 100 | [DllImport("Everything32.dll")] 101 | public static extern UInt32 Everything_GetLastError(); 102 | 103 | [DllImport("Everything32.dll")] 104 | public static extern bool Everything_QueryW(bool bWait); 105 | 106 | [DllImport("Everything32.dll")] 107 | public static extern void Everything_SortResultsByPath(); 108 | 109 | [DllImport("Everything32.dll")] 110 | public static extern UInt32 Everything_GetNumFileResults(); 111 | [DllImport("Everything32.dll")] 112 | public static extern UInt32 Everything_GetNumFolderResults(); 113 | [DllImport("Everything32.dll")] 114 | public static extern UInt32 Everything_GetNumResults(); 115 | [DllImport("Everything32.dll")] 116 | public static extern UInt32 Everything_GetTotFileResults(); 117 | [DllImport("Everything32.dll")] 118 | public static extern UInt32 Everything_GetTotFolderResults(); 119 | [DllImport("Everything32.dll")] 120 | public static extern UInt32 Everything_GetTotResults(); 121 | [DllImport("Everything32.dll")] 122 | public static extern bool Everything_IsVolumeResult(UInt32 nIndex); 123 | [DllImport("Everything32.dll")] 124 | public static extern bool Everything_IsFolderResult(UInt32 nIndex); 125 | [DllImport("Everything32.dll")] 126 | public static extern bool Everything_IsFileResult(UInt32 nIndex); 127 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 128 | public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount); 129 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 130 | public static extern IntPtr Everything_GetResultPath(UInt32 nIndex); 131 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 132 | public static extern IntPtr Everything_GetResultFileName(UInt32 nIndex); 133 | 134 | [DllImport("Everything32.dll")] 135 | public static extern void Everything_Reset(); 136 | [DllImport("Everything32.dll")] 137 | public static extern void Everything_CleanUp(); 138 | [DllImport("Everything32.dll")] 139 | public static extern UInt32 Everything_GetMajorVersion(); 140 | [DllImport("Everything32.dll")] 141 | public static extern UInt32 Everything_GetMinorVersion(); 142 | [DllImport("Everything32.dll")] 143 | public static extern UInt32 Everything_GetRevision(); 144 | [DllImport("Everything32.dll")] 145 | public static extern UInt32 Everything_GetBuildNumber(); 146 | [DllImport("Everything32.dll")] 147 | public static extern bool Everything_Exit(); 148 | [DllImport("Everything32.dll")] 149 | public static extern bool Everything_IsDBLoaded(); 150 | [DllImport("Everything32.dll")] 151 | public static extern bool Everything_IsAdmin(); 152 | [DllImport("Everything32.dll")] 153 | public static extern bool Everything_IsAppData(); 154 | [DllImport("Everything32.dll")] 155 | public static extern bool Everything_RebuildDB(); 156 | [DllImport("Everything32.dll")] 157 | public static extern bool Everything_UpdateAllFolderIndexes(); 158 | [DllImport("Everything32.dll")] 159 | public static extern bool Everything_SaveDB(); 160 | [DllImport("Everything32.dll")] 161 | public static extern bool Everything_SaveRunHistory(); 162 | [DllImport("Everything32.dll")] 163 | public static extern bool Everything_DeleteRunHistory(); 164 | [DllImport("Everything32.dll")] 165 | public static extern UInt32 Everything_GetTargetMachine(); 166 | 167 | // Everything 1.4 168 | [DllImport("Everything32.dll")] 169 | public static extern void Everything_SetSort(UInt32 dwSortType); 170 | [DllImport("Everything32.dll")] 171 | public static extern UInt32 Everything_GetSort(); 172 | [DllImport("Everything32.dll")] 173 | public static extern UInt32 Everything_GetResultListSort(); 174 | [DllImport("Everything32.dll")] 175 | public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags); 176 | [DllImport("Everything32.dll")] 177 | public static extern UInt32 Everything_GetRequestFlags(); 178 | [DllImport("Everything32.dll")] 179 | public static extern UInt32 Everything_GetResultListRequestFlags(); 180 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 181 | public static extern IntPtr Everything_GetResultExtension(UInt32 nIndex); 182 | [DllImport("Everything32.dll")] 183 | public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize); 184 | [DllImport("Everything32.dll")] 185 | public static extern bool Everything_GetResultDateCreated(UInt32 nIndex, out long lpFileTime); 186 | [DllImport("Everything32.dll")] 187 | public static extern bool Everything_GetResultDateModified(UInt32 nIndex, out long lpFileTime); 188 | [DllImport("Everything32.dll")] 189 | public static extern bool Everything_GetResultDateAccessed(UInt32 nIndex, out long lpFileTime); 190 | [DllImport("Everything32.dll")] 191 | public static extern UInt32 Everything_GetResultAttributes(UInt32 nIndex); 192 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 193 | public static extern IntPtr Everything_GetResultFileListFileName(UInt32 nIndex); 194 | [DllImport("Everything32.dll")] 195 | public static extern UInt32 Everything_GetResultRunCount(UInt32 nIndex); 196 | [DllImport("Everything32.dll")] 197 | public static extern bool Everything_GetResultDateRun(UInt32 nIndex, out long lpFileTime); 198 | [DllImport("Everything32.dll")] 199 | public static extern bool Everything_GetResultDateRecentlyChanged(UInt32 nIndex, out long lpFileTime); 200 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 201 | public static extern IntPtr Everything_GetResultHighlightedFileName(UInt32 nIndex); 202 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 203 | public static extern IntPtr Everything_GetResultHighlightedPath(UInt32 nIndex); 204 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 205 | public static extern IntPtr Everything_GetResultHighlightedFullPathAndFileName(UInt32 nIndex); 206 | [DllImport("Everything32.dll")] 207 | public static extern UInt32 Everything_GetRunCountFromFileName(string lpFileName); 208 | [DllImport("Everything32.dll")] 209 | public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount); 210 | [DllImport("Everything32.dll")] 211 | public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName); 212 | 213 | public Form1() 214 | { 215 | InitializeComponent(); 216 | } 217 | 218 | private void button1_Click(object sender, EventArgs e) 219 | { 220 | UInt32 i; 221 | 222 | // set the search 223 | Everything_SetSearchW(textBox1.Text); 224 | 225 | // use our own custom scrollbar... 226 | // Everything_SetMax(listBox1.ClientRectangle.Height / listBox1.ItemHeight); 227 | // Everything_SetOffset(VerticalScrollBarPosition...); 228 | 229 | // request name and size 230 | Everything_SetRequestFlags(EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_DATE_MODIFIED | EVERYTHING_REQUEST_SIZE); 231 | 232 | Everything_SetSort(13); 233 | 234 | // execute the query 235 | Everything_QueryW(true); 236 | 237 | // sort by path 238 | // Everything_SortResultsByPath(); 239 | 240 | // clear the old list of results 241 | listBox1.Items.Clear(); 242 | 243 | // set the window title 244 | Text = textBox1.Text + " - " + Everything_GetNumResults() + " Results"; 245 | 246 | // loop through the results, adding each result to the listbox. 247 | for (i = 0; i < Everything_GetNumResults(); i++) 248 | { 249 | long date_modified; 250 | long size; 251 | 252 | Everything_GetResultDateModified(i, out date_modified); 253 | Everything_GetResultSize(i, out size); 254 | 255 | // add it to the list box 256 | listBox1.Items.Insert((int)i, "Size: " + size.ToString() + " Date Modified: " + DateTime.FromFileTime(date_modified).Year + "/" + DateTime.FromFileTime(date_modified).Month + "/" + DateTime.FromFileTime(date_modified).Day + " " + DateTime.FromFileTime(date_modified).Hour + ":" + DateTime.FromFileTime(date_modified).Minute.ToString("D2") + " Filename: " + Marshal.PtrToStringUni(Everything_GetResultFileName(i))); 257 | } 258 | } 259 | } 260 | } -------------------------------------------------------------------------------- /Source/IEverything.cpp: -------------------------------------------------------------------------------- 1 | #include "IEverything.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "Utils.h" 11 | 12 | #if defined _WIN32 13 | # pragma comment(lib, "Everything32.lib") 14 | # pragma comment(lib, "MinHook.x86.lib") 15 | #elif defined _WIN64 16 | # pragma comment(lib, "Everything64.lib") 17 | # pragma comment(lib, "MinHook.x64.lib") 18 | #else 19 | # error "Unknown compilation target." 20 | #endif 21 | 22 | 23 | IEverything& IEverything::GetInstance() 24 | { 25 | static IEverything i; 26 | return i; 27 | } 28 | 29 | IEverything::IEverything() 30 | { 31 | memset(&_ProcessInfo, 0, sizeof(_ProcessInfo)); 32 | } 33 | 34 | IEverything::~IEverything() 35 | { 36 | ExitBackend(); 37 | } 38 | 39 | void IEverything::LaunchBackend() 40 | { 41 | using namespace std::literals::chrono_literals; 42 | 43 | if (_IsLaunched) { 44 | return; 45 | } 46 | 47 | PrepareLaunch(); 48 | 49 | // Launch Everything 50 | // 51 | STARTUPINFOW StartupInfo; 52 | memset(&StartupInfo, 0, sizeof(StartupInfo)); 53 | StartupInfo.cb = sizeof(StartupInfo); 54 | 55 | QString CommandLine = "\"Everything\\Everything.exe\" -startup -instance \"VsCacheCleaner\""; 56 | 57 | // In VS debug mode, the API cannot find the relative path file in the first argument, 58 | // because it is relative to the VS solution path. 59 | // 60 | // This function can modify the contents of the second string. 61 | // Therefore, the parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). 62 | // If the parameter is a constant string, the function may cause an access violation. 63 | // 64 | if (!CreateProcessW( 65 | nullptr, 66 | CommandLine.toStdWString().data(), 67 | nullptr, 68 | nullptr, 69 | false, 70 | 0, 71 | nullptr, 72 | nullptr, 73 | &StartupInfo, 74 | &_ProcessInfo)) 75 | { 76 | FatalError("Launch Everything client failed.\nErrorCode: " + QString::number(GetLastError())); 77 | } 78 | 79 | // Wait Everything initialize IPC 80 | // 81 | 82 | uint32_t RetryCount = 0; 83 | while (Everything_GetBuildNumber() == 0 && RetryCount < 100) 84 | { 85 | std::this_thread::sleep_for(100ms); 86 | ++RetryCount; 87 | } 88 | 89 | if (Everything_GetBuildNumber() == 0) { 90 | FatalError("Connect to Everything failed."); 91 | } 92 | 93 | if (!Everything_IsAdmin()) { 94 | FatalError(QObject::tr("Everything client requires administrative privileges to index NTFS volumes.\nPlease try to reopen VsCacheCleaner as administrator."), false); 95 | } 96 | 97 | _IsLaunched = true; 98 | } 99 | 100 | void IEverything::ExitBackend() 101 | { 102 | _IsLaunched = false; 103 | 104 | if (_ProcessInfo.hProcess != nullptr) 105 | { 106 | if (IsInitialized()) { 107 | Everything_SaveDB(); 108 | } 109 | Everything_Exit(); 110 | TerminateProcess(_ProcessInfo.hProcess, 0); 111 | } 112 | } 113 | 114 | bool IEverything::IsInitialized() 115 | { 116 | return Everything_IsDBLoaded(); 117 | } 118 | 119 | uint32_t IEverything::GetErrorCode() 120 | { 121 | return Everything_GetLastError(); 122 | } 123 | 124 | std::optional> IEverything::Search( 125 | const QString &String, 126 | const Et::SearchOptionsT &SearchOptions 127 | ) 128 | { 129 | std::optional> Result; // HACK for NRVO 130 | 131 | do { 132 | QVector Items; 133 | 134 | // Require nothing 135 | // 136 | 137 | if (!SearchOptions.testFlag(Et::SearchOptionE::RequireFile) && !SearchOptions.testFlag(Et::SearchOptionE::RequireFolder)) { 138 | Result = std::move(Items); 139 | break; 140 | } 141 | 142 | if (!SearchQuery(String, SearchOptions)) { 143 | Result = std::nullopt; 144 | break; 145 | } 146 | 147 | uint32_t TotalResults = Everything_GetNumResults(); 148 | if (TotalResults == 0) { 149 | Result = std::move(Items); 150 | break; 151 | } 152 | 153 | Items.resize(TotalResults); 154 | 155 | for (uint32_t i = 0; i < TotalResults; ++i) 156 | { 157 | if (!_IsLaunched) { 158 | break; 159 | } 160 | 161 | Et::ItemDataT ItemData = GetResultData(i); 162 | 163 | // Check type 164 | // 165 | if (!(SearchOptions.testFlag(Et::SearchOptionE::RequireFile) && ItemData.Type == Et::ItemTypeE::File || 166 | SearchOptions.testFlag(Et::SearchOptionE::RequireFolder) && ItemData.Type == Et::ItemTypeE::Folder)) 167 | { 168 | FatalError(QString{"Searched data invalid.\nIndex: %1\nOptions: %2\nType: %3"} 169 | .arg(i).arg(SearchOptions).arg((uint32_t)ItemData.Type)); 170 | } 171 | 172 | Items[i] = std::move(ItemData); 173 | } 174 | 175 | // Exclude trash files 176 | // 177 | Items.erase(std::remove_if(Items.begin(), Items.end(), 178 | [](const Et::ItemDataT &item) { 179 | return item.FullPathName.toUpper().indexOf("$RECYCLE.BIN") != -1; 180 | } 181 | ), Items.end()); 182 | 183 | if (!_IsLaunched) { 184 | Result = std::nullopt; 185 | break; 186 | } 187 | 188 | Result = std::move(Items); 189 | 190 | } while (false); 191 | 192 | return Result; 193 | } 194 | 195 | void IEverything::PrepareLaunch() 196 | { 197 | // We do not place the database in the running directory, but in the temporary directory. 198 | // This can prevent users from accidentally sharing the VsCacheCleaner client with the disk database. 199 | // 200 | 201 | // Create and cd to the new database folder 202 | // 203 | QDir DbFolder = QDir::temp(); 204 | if (!DbFolder.exists("VsCacheCleaner")) { 205 | if (!DbFolder.mkdir("VsCacheCleaner")) { 206 | FatalError("Create database folder failed.\nTemp path: " + DbFolder.path()); 207 | } 208 | } 209 | VCC_ASSERT(DbFolder.cd("VsCacheCleaner")); 210 | 211 | // Currently the Everything-SDK does not support multiple instances. 212 | // The following code is a workaround to make the Everything-SDK support multiple instances. 213 | // 214 | MH_STATUS Status = MH_Initialize(); 215 | if (Status != MH_OK) { 216 | FatalError(QString{"MH_Initialize() failed.\nStatus: "} + MH_StatusToString(Status)); 217 | } 218 | if (MH_CreateHookApi(L"User32.dll", "FindWindowA", &DetourFindWindow, (void**)&_FnOriginalFindWindow) != MH_OK || 219 | MH_CreateHookApi(L"User32.dll", "FindWindowW", &DetourFindWindow, (void**)&_FnOriginalFindWindow) != MH_OK) 220 | { 221 | FatalError(QString{"MH_CreateHookApi() failed.\nStatus: "} + MH_StatusToString(Status)); 222 | } 223 | if (MH_EnableHook(MH_ALL_HOOKS) != MH_OK) { 224 | FatalError(QString{"MH_EnableHook() failed.\nStatus: "} + MH_StatusToString(Status)); 225 | } 226 | 227 | // The following code is a workaround to configure the Everything. 228 | // Currently the Everything-SDK does not support changing the Everything settings. 229 | // We have to modify the Everything.ini configuration file manually. 230 | // 231 | 232 | // Get Everything client directory 233 | // 234 | QDir EtFolder = QCoreApplication::applicationDirPath(); // QDir::currentPath() will return VS solution path in VS debug mode 235 | if (!EtFolder.cd("Everything") || !EtFolder.exists("Everything.exe")) { 236 | FatalError(QObject::tr("Everything client is missing.\nPlease try to reinstall VsCacheCleaner."), false); 237 | } 238 | 239 | QString ConfigFile = "Everything-VsCacheCleaner.ini"; 240 | 241 | // Delete the old configuration file if it exists 242 | // 243 | if (EtFolder.exists(ConfigFile)) { 244 | if (!EtFolder.remove(ConfigFile)) { 245 | FatalError("Delete the old Everything configuration file failed."); 246 | } 247 | } 248 | 249 | // Write configuration data 250 | // The reason for not using QSettings is that QSettings will internally convert '\\' to '\\\\' 251 | // 252 | QString EtConfig = EtFolder.filePath(ConfigFile); 253 | if (!WritePrivateProfileStringW(L"Everything", L"db_location", QDir::toNativeSeparators(DbFolder.path()).toStdWString().c_str(), EtConfig.toStdWString().c_str()) || 254 | !WritePrivateProfileStringW(L"Everything", L"index_date_accessed", L"1" /* true */, EtConfig.toStdWString().c_str()) || 255 | !WritePrivateProfileStringW(L"Everything", L"index_folder_size", L"1" /* true */, EtConfig.toStdWString().c_str())) 256 | { 257 | FatalError("WritePrivateProfileStringW() failed.\nErrorCode: " + QString::number(GetLastError())); 258 | } 259 | } 260 | 261 | bool IEverything::SearchQuery(const QString &String, const Et::SearchOptionsT &SearchOptions) 262 | { 263 | uint32_t RequestFlags = EVERYTHING_REQUEST_FILE_NAME | EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_SIZE; 264 | RequestFlags |= SearchOptions.testFlag(Et::SearchOptionE::RequireAccessedDate) ? EVERYTHING_REQUEST_DATE_ACCESSED : 0; 265 | Everything_SetRequestFlags(RequestFlags); 266 | 267 | Everything_SetMatchPath(false); 268 | Everything_SetMatchCase(SearchOptions.testFlag(Et::SearchOptionE::MatchCase)); 269 | Everything_SetMatchWholeWord(SearchOptions.testFlag(Et::SearchOptionE::MatchWholeWord)); 270 | 271 | QString Modifiers; 272 | 273 | // Currently the Everything-SDK does not provide APIs to set these options, so a workaround is to use String argument 274 | // See more: https://www.voidtools.com/support/everything/command_line_options/#searching 275 | // 276 | if (SearchOptions.testFlag(Et::SearchOptionE::MatchWholeFileName)) { 277 | Modifiers += "wholefilename:"; 278 | } 279 | 280 | if (!(SearchOptions.testFlag(Et::SearchOptionE::RequireFile) && SearchOptions.testFlag(Et::SearchOptionE::RequireFolder))) 281 | { 282 | if (SearchOptions.testFlag(Et::SearchOptionE::RequireFile)) { 283 | Modifiers += "files:"; 284 | } 285 | else { 286 | Modifiers += "folders:"; 287 | } 288 | } 289 | 290 | Everything_SetSearchW((Modifiers + "\"" + String + "\"").toStdWString().c_str()); 291 | 292 | if (!Everything_QueryW(true)) { 293 | CheckErrorCausedByIPC(); 294 | return false; 295 | } 296 | 297 | return true; 298 | } 299 | 300 | Et::ItemDataT IEverything::GetResultData(uint32_t Index) 301 | { 302 | Et::ItemDataT Result; 303 | 304 | // Get type 305 | // 306 | if (Everything_IsFileResult(Index)) { 307 | Result.Type = Et::ItemTypeE::File; 308 | } 309 | else if (Everything_IsFolderResult(Index)) { 310 | Result.Type = Et::ItemTypeE::Folder; 311 | } 312 | else { 313 | Result.Type = Et::ItemTypeE::Unknown; 314 | } 315 | 316 | // Get full path name 317 | // 318 | uint32_t FullPathNameCount = Everything_GetResultFullPathNameW(Index, nullptr, 0); 319 | if (FullPathNameCount == 0) { 320 | FatalError("Everything_GetResultFullPathNameW() first returned 0."); 321 | } 322 | 323 | Result.FullPathName.resize(FullPathNameCount); 324 | uint32_t FullPathNameCopiedCount = Everything_GetResultFullPathNameW(Index, (wchar_t*)Result.FullPathName.data(), Result.FullPathName.size() + 1); 325 | if (FullPathNameCopiedCount == 0) { 326 | FatalError("Everything_GetResultFullPathNameW() second returned 0."); 327 | } 328 | 329 | // Get file name 330 | // 331 | const wchar_t *FileName = Everything_GetResultFileNameW(Index); 332 | if (FileName == nullptr) { 333 | FatalError("Everything_GetResultFileNameW() returned nullptr."); 334 | } 335 | Result.FileName = QString::fromWCharArray(FileName); 336 | 337 | // Get size 338 | // 339 | LARGE_INTEGER Size; 340 | if (!Everything_GetResultSize(Index, &Size)) { 341 | Result.DataSize = std::nullopt; 342 | } 343 | else { 344 | Result.DataSize = Size.QuadPart; 345 | } 346 | 347 | // Get accessed date 348 | // 349 | FILETIME AccessedDate; 350 | SYSTEMTIME ConvertedAccessedDate; 351 | if (Everything_GetResultDateAccessed(Index, &AccessedDate) && FileTimeToSystemTime(&AccessedDate, &ConvertedAccessedDate)) { 352 | Result.AccessedDate = System::SystemTimeToQDateTime(ConvertedAccessedDate); 353 | } 354 | 355 | return Result; 356 | } 357 | 358 | void IEverything::CheckErrorCausedByIPC() 359 | { 360 | if (_IsLaunched && GetErrorCode() == EVERYTHING_ERROR_IPC) { 361 | FatalError(QObject::tr("Everything client is not running.\nPlease try to reopen VsCacheCleaner."), false); 362 | } 363 | } 364 | 365 | // Workaround begin 366 | // 367 | 368 | template 369 | HWND IEverything::DetourFindWindow(const CharT *ClassName, const CharT *WindowName) 370 | { 371 | QString RealClassName; 372 | if constexpr (std::is_same_v) { 373 | RealClassName = QString{ClassName}; 374 | } 375 | else { 376 | RealClassName = QString::fromWCharArray(ClassName); 377 | } 378 | 379 | // Append the instance name 380 | // 381 | if (RealClassName == "EVERYTHING_TASKBAR_NOTIFICATION") { 382 | RealClassName += "_(VsCacheCleaner)"; 383 | } 384 | 385 | if constexpr (std::is_same_v) { 386 | return _FnOriginalFindWindow(RealClassName.toStdString().c_str(), WindowName); 387 | } 388 | else { 389 | return _FnOriginalFindWindow(RealClassName.toStdWString().c_str(), WindowName); 390 | } 391 | } 392 | -------------------------------------------------------------------------------- /Resource/Translations/vcc_zh_CN.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QObject 6 | 7 | 8 | Everything client requires administrative privileges to index NTFS volumes. 9 | Please try to reopen VsCacheCleaner as administrator. 10 | Everything 客户端需要管理员权限来索引 NTFS 卷。 11 | 请尝试以管理员身份重新打开 VsCacheCleaner。 12 | 13 | 14 | 15 | Everything client is missing. 16 | Please try to reinstall VsCacheCleaner. 17 | Everything 客户端丢失。 18 | 请尝试重新安装 VsCacheCleaner。 19 | 20 | 21 | 22 | Everything client is not running. 23 | Please try to reopen VsCacheCleaner. 24 | Everything 客户端未在运行。 25 | 请尝试重新打开 VsCacheCleaner。 26 | 27 | 28 | 29 | An error has occurred! 30 | Please help us fix this problem. 31 | -------------------------------------------------- 32 | 33 | %1 34 | 35 | -------------------------------------------------- 36 | Click "Abort" or "Ignore" will pop up GitHub issue tracker page. 37 | You can submit this information to us there. 38 | Thank you very much! 39 | 发生了一个错误! 40 | 请帮助我们修复这个问题。 41 | -------------------------------------------------- 42 | 43 | %1 44 | 45 | -------------------------------------------------- 46 | 单击“中止”或“忽略”将弹出 GitHub 问题跟踪页面。 47 | 您可以在那里将该信息提交给我们。 48 | 非常感谢您! 49 | 50 | 51 | 52 | VsCacheCleaner fatal error 53 | VsCacheCleaner 致命错误 54 | 55 | 56 | 57 | UserInterface::CacheItemsRcMenuT 58 | 59 | 60 | Open folder 61 | 打开文件夹 62 | 63 | 64 | 65 | Copy path 66 | 复制路径 67 | 68 | 69 | 70 | Check selected items 71 | 勾选选中项 72 | 73 | 74 | 75 | Uncheck selected items 76 | 取消勾选选中项 77 | 78 | 79 | 80 | UserInterface::CacheItemsTableModelT 81 | 82 | 83 | Path 84 | 路径 85 | 86 | 87 | 88 | Size 89 | 大小 90 | 91 | 92 | 93 | AccessedDate 94 | 访问日期 95 | 96 | 97 | 98 | UserInterface::MainWindowT 99 | 100 | 101 | 102 | Cache 103 | 缓存 104 | 105 | 106 | 107 | 108 | Other 109 | 其他 110 | 111 | 112 | 113 | 114 | Free 115 | 空闲 116 | 117 | 118 | 119 | Detected the Visual Studio is running. 120 | 121 | %1 122 | Please close the above processes and try again. 123 | 检测到 Visual Studio 正在运行。 124 | 125 | %1 126 | 请关闭以上进程后重试。 127 | 128 | 129 | 130 | Checked %1 items. 131 | 勾选了 %1 项。 132 | 133 | 134 | 135 | Ready. 136 | 就绪。 137 | 138 | 139 | 140 | Everything client is initializing, please wait%1 (First time may be a little slow) 141 | Everything 客户端正在初始化,请稍等%1 (首次可能较慢) 142 | 143 | 144 | 145 | Info 146 | 信息 147 | 148 | 149 | 150 | Warning 151 | 警告 152 | 153 | 154 | 155 | Error 156 | 错误 157 | 158 | 159 | 160 | Cache (%1) 161 | 缓存(%1) 162 | 163 | 164 | 165 | Other (%1) 166 | 其他(%1) 167 | 168 | 169 | 170 | Free (%1) 171 | 空闲(%1) 172 | 173 | 174 | 175 | Select Path 176 | 选择路径 177 | 178 | 179 | 180 | Scan path is not a directory. 181 | 扫描的路径不是一个目录。 182 | 183 | 184 | 185 | 186 | Scan failed. ErrorCode: %1-%2 187 | 扫描失败。错误代码:%1-%2 188 | 189 | 190 | 191 | Scan completed. %1 results. 192 | 扫描完成。共有 %1 个结果。 193 | 194 | 195 | 196 | Scanning%1 197 | 扫描中%1 198 | 199 | 200 | 201 | (%1/%2) Deleting caches%3 (%4) 202 | (%1/%2)删除缓存中%3 (%4) 203 | 204 | 205 | 206 | No items are checked. 207 | 没有选中项。 208 | 209 | 210 | 211 | Delete completed. %1 cache cleared. (%2 successed, %3 failed) 212 | 删除完成。清除了 %1 缓存。(成功 %2 个,失败 %3 个) 213 | 214 | 215 | 216 | <h3>VsCacheCleaner</h3><p>Visual Studio Solution Cache Cleaner</p><hr><p>Version %1 (<a href="%2">Change log</a>)</p><p>Open source on <a href="%3">%4</a></p><p>Licensed under the <a href="%5">%6</a></p><p>Folder search is based on <a href="%7">%8</a></p>%9 217 | <h3>VsCacheCleaner</h3><p>Visual Studio 解决方案缓存清理器</p><hr><p>版本 %1(<a href="%2">更新日志</a>)</p><p>开源在 <a href="%3">%4</a> 上</p><p>根据 <a href="%5">%6</a> 许可</p><p>文件夹搜索基于 <a href="%7">%8</a></p>%9 218 | 219 | 220 | 221 | About VsCacheCleaner 222 | 关于 VsCacheCleaner 223 | 224 | 225 | 226 | VsCacheCleanerClass 227 | 228 | 229 | VsCacheCleaner 230 | VsCacheCleaner 231 | 232 | 233 | 234 | Path: 235 | 路径: 236 | 237 | 238 | 239 | If empty, all disks will be scanned 240 | 如果为空,则扫描所有磁盘 241 | 242 | 243 | 244 | Select 245 | 选择 246 | 247 | 248 | 249 | Scan 250 | 扫描 251 | 252 | 253 | 254 | Delete 255 | 删除 256 | 257 | 258 | 259 | Rule 260 | 规则 261 | 262 | 263 | 264 | Help 265 | 帮助 266 | 267 | 268 | 269 | Check items accessed 7 days ago 270 | 勾选 7 天前访问的项 271 | 272 | 273 | 274 | Check items accessed 1 month ago 275 | 勾选 1 个月前访问的项 276 | 277 | 278 | 279 | Check items accessed 3 months ago 280 | 勾选 3 个月前访问的项 281 | 282 | 283 | 284 | Check items accessed 6 months ago 285 | 勾选 6 个月前访问的项 286 | 287 | 288 | 289 | Check items accessed 1 year ago 290 | 勾选 1 年前访问的项 291 | 292 | 293 | 294 | Report issue... 295 | 反馈问题... 296 | 297 | 298 | 299 | Check update... 300 | 检查更新... 301 | 302 | 303 | 304 | About 305 | 关于 306 | 307 | 308 | 309 | Check items greater than 50 MB in size 310 | 勾选大小超过 50 MB 的项 311 | 312 | 313 | 314 | Check items greater than 100 MB in size 315 | 勾选大小超过 100 MB 的项 316 | 317 | 318 | 319 | Check items greater than 500 MB in size 320 | 勾选大小超过 500 MB 的项 321 | 322 | 323 | 324 | Check items greater than 1 GB in size 325 | 勾选大小超过 1 GB 的项 326 | 327 | 328 | 329 | Check items greater than 3 GB in size 330 | 勾选大小超过 3 GB 的项 331 | 332 | 333 | 334 | --------------------------------------------------------------------------------