Skip to content

Commit a0caa95

Browse files
2 parents 66cdad8 + 3276edb commit a0caa95

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
19.7 KB
Loading

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# FolderDeepSearchV2
2+
A simple application for searching folders for items (files, folders or file contents), with recursive search options, string options, etc.
3+
4+
I made this as a replacement for windows explorer's dreadful search feature which takes forever just to find a file (as it's indexing while searching. Even after turning that off, it's still slow). This app does no indexing.
5+
6+
The search is done asynchronously, to stop the UI thread freezing. I made the start and stop buttons separate, just in case you try to cancel the search, but end up starting it again because it finished right as you clicked the button
7+
8+
## Preview
9+
Planning on making the UI a bit less "clunky" (It just seems a bit clogged to me; i'm not great at UI design)
10+
![](FolderDeepSearchV2_2022-12-06_16.38.19.png)
11+
12+
## Features
13+
On the right of the screen is a toggle button, which opens a menu, which contains the search options (which are all checkboxes, allowing you to combine them all)
14+
- Search folder names
15+
- Search file names
16+
- Search file contents
17+
- Enable/disable case sensitivity (disable by default; meaning, cases are ignored; "hElLO" matches "Hello")
18+
- Recursively search into folders (disabled by default; meaning, only the Start Folder is searched)
19+
- Ignore file extension (completely forgot what this does)
20+
- File/Folder match only if it starts with the search term (disabled by default; meaning a file called "Hi there.txt" may match a search term "there". But when enabled, it would not match. "A search term of "hi" may match, both cases depending on the case sensitivity option)
21+
22+
Also, when the app opens, the search bar is automatically focused so you don't need to click it. Clicking the Esc key will close the app (for convenience, if you only needed to do a quick search)
23+
24+
There are some shortcuts to toggling options, instead of having to use the menu on the right
25+
26+
- CTRL + B - Toggle case sensitivity (couldn't use CTRL + C, as it's used for copy)
27+
- CTRL + R - Toggles recursive searching
28+
- CTRL + N - Toggle match when folder/file name starts with search term instead of containing it
29+
- CTRL + O - Shortcut for opening a folder
30+
- Pressing enter while the search term box is focused will begin the search
31+
32+
## Extra details
33+
34+
Searching file contents reads in chunks of 1024 bytes; does not load the entire file into memory. I wrote this to be as efficient as possible, using a fixed buffer size + size of the search term, and (n being the search term's string length) copies n number of chars from the end to the start, and when reading chars from files, begins at index n into the buffer. All of this in the case that the search term is split between 2 chunk reads
35+
36+
Icon fetching is done mostly asynchronously, via the FileIconService. A "queued icon" is added to a concurrent queue. Those queues are then processed by a thread (which spends 10ms sleeping per tick, likely more due to thread time slicing). The actual icon resolution is performed on the main thread (via the dispatcher), due to the implications of creating Bitmaps outside of the main thread. Those bitmaps are then stored in an updateQueue, which are processed on another thread and finally delivered via the main thread using the dispatcher again
37+
38+
## Adding to windows context menus
39+
40+
It's possible to add a few registry options to open the app in the folder you're currently in (in windows explorer).
41+
- Go to `Computer\HKEY_CLASSES_ROOT\Directory\Background\shell`
42+
- Create a new key/folder called `FolderDeepSearch` (or anything you'd like)
43+
- Inside that, set the (Default)'s contents to the text you want in the windows context menu (e.g `Search folder...`)
44+
- Optionally, create a new string called "Icon" and set the path to this app's .exe (you have to compile it obviously to get the exe file)
45+
- Create a sub-key called `command`
46+
- Set the (Default) contents to `"path to the app exe" "%V"` (make sure to include the quotes)
47+
After doing that, it should appear in your context menu, and when you click it, it will set the app's start folder to which ever folder you opened the app in (This is processed in Application_Startup() in App.xaml.cs using StartupEventArgs)

0 commit comments

Comments
 (0)