Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

AceUtitlies

A Windows application that actually search Windows for files! What an idea? Also a Windows 11 Notepad replacement and a few other miscellaneous utilites.

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

Ace's Utilities (AceUtils)

"A Windows application that actually search Windows for files! What an idea? Also a Windows 11 Notepad replacement and a few other miscellaneous utilites."

Ace's Utilities (AceUtils) is a high-performance, lightweight desktop power tool written in Object Pascal using the Free Pascal Compiler (FPC) and Lazarus LCL. While tailored for modern Windows workflows, the entire codebase is written using portable LCL components and clean conditional directives, allowing it to be compiled and run on Linux very easily.

It also takes back the .txt and .md associations Windows keeps STEALING. No admin rights, no registry surgery on your end.


✨ Key Features

⚡ 1. Context Menu Management & Windows 11 Association Takeover

Microsoft keeps hijacking file associations in Windows 11 using hidden UserChoice / UserChoiceLatest registry keys, forcing files to open in modern UWP Notepad even after you set your defaults. Ace's Utilities fixes this once and for all:

  • Take Back Stolen File Associations: Reclaims .txt, .md, and .markdown defaults with a single click. Wipes out the Windows 11 UserChoiceLatest hijack, registers clean ProgIDs, and broadcasts shell notifications—100% per-user with zero admin rights and zero reboots.
  • Per-User Shell Verb Scanner: Audits all registered context menu entries in HKCU\Software\Classes across * (all files), Directory (folders), Background, .txt, .md, and registered Applications.
  • Stale / Orphaned Entry Detection: Automatically parses target commands and inspects the filesystem to flag dead entries whose executables no longer exist (e.g., from uninstalled or renamed apps).
  • One-Click Stale Purge: Instantly cleans out all orphaned shell verbs in one click.
  • Edit & Remap Commands: Modify display labels and repoint command-line paths for any user context menu item directly from the UI.
  • Context Menu Toggle: Add or remove "Open with Ace's Utilities" from Explorer right-click menus on the fly.
  • Headless CLI Registration: Supports /register and /unregister flags for silent scripting or automated deployment.

🔍 2. Real Windows File Search (That Actually Works)

Tired of Windows Search indexing freezes, search loops, or failing to find files that are right in front of you?

  • Fast Traversal Engine: Safe Breadth-First Search (BFS) directory walker.
  • Instant & Non-Blocking Stop: Responsive UI polling every 50ms ensures clicking "Stop" cancels deep searches instantaneously without freezes or Windows "(Not Responding)" lockups.
  • Pre-Parsed Pattern Engine: Pattern lists are compiled once per search, eliminating per-file memory churn and boosting traversal speeds.
  • Smart Directory Detection: Pasting a full file path (or quoted path) into the search directory field automatically resolves to its parent folder.
  • Junction Point & Symlink Protection: Automatically skips NTFS reparse points (FILE_ATTRIBUTE_REPARSE_POINT $400), avoiding endless recursion loops common in Windows 11 user directories (e.g. Application Data).
  • Flexible Pattern Matching: Type *.pas or simply MainForm—terms without explicit wildcards automatically perform substring searches. Multiple patterns can be delimited by semicolons (*.pas;*.lpr;*.md).
  • Content Search: Full-text scanning inside files with configurable case sensitivity and graceful stopping.
  • Interactive Multi-Column Header Sorting: Click any column (File Name, Folder, Size, Modified Date, Type) to sort Ascending (▲) or Descending (▼). File sizes sort by true numeric byte count (so 10 MB correctly sorts higher than 2 KB).
  • Directory Tree & Quick Buttons: Includes a full TShellTreeView, directory browse dialog, and one-click quick jump buttons for C:\, User Home, and Desktop.
  • Rich Results Context Menu: Right-click any search result to Open in Notepad, Reveal in Explorer, Open / Run File, Copy Filename Only, Copy File Path Only, or Copy File Path and Name (with multi-item selection clipboard support).

📁 3. The Real Explorer

Frustrated by modern Windows Explorer hiding folders or switching views? The Real Explorer provides a fast, permanent classic file manager:

  • Folders First & Permanent Details View: Reliable directory navigation where folders always stay grouped at the top and detailed columns (Name, Size, Modified, Type) stay fixed.
  • Always Sorted, Your Way: Listings open sorted by Type by default (folders first, then files grouped by extension). Click any column header or use Go → Sort By to sort by Name, Size, or Date Modified (sizes and dates start largest / newest first). Your choice is remembered, and the order holds after refresh, rename, delete, and new folder.
  • Smart Address Bar: Paste full file paths, filenames, or quoted paths (e.g. "C:\Users\User\Desktop\unfollow-day1.md" or C:\file.txt) directly into the path edit. The Explorer intelligently detects whether the input is a file or folder, navigates to the parent directory, auto-selects the file in the list, and opens it in the floating Live Preview window.
  • Full Navigation Stack: Back, Forward, Up, and Refresh buttons with dynamic history management.
  • Quick Jump Chips: One-click jump buttons for Desktop, Downloads, Documents, Pictures, Drive C:\, and User Home.
  • Custom Default Startup Folder: Set your favorite starting location (e.g., Desktop or Project root) with a single click of "Set Default".
  • Floating Preview & Context Actions: Dedicated Preview button, Recycle Bin deletion, in-place rename, and seamless "Open in Notepad" tab routing.
  • Keyboard Navigation: Alt+Left / Alt+Right back and forward, Alt+Up (or Backspace) up one level, Alt+Home default folder, Ctrl+L address bar, F5 refresh, Ctrl+Shift+N new folder, and Ctrl+F to search the folder you are browsing.

👁️ 4. Floating Live File Preview Window

Preview files dynamically on a single click without blocking the main search window:

  • Modeless Floating Window: Stays open side-by-side with your search list; click any result and the preview updates instantaneously.
  • Image Previews: Seamless native rendering for .png, .jpg, .jpeg, .bmp, .ico, and .gif with proportional scaling, dimension readouts (Width x Height), and file size.
  • PDF Previews: Full page rendering through PDFium (the engine inside Chrome). Pages fit the window and re-render on resize. Browse with ◀ Prev / Next ▶, the mouse wheel, or PgUp / PgDn / Home / End. Password-protected or damaged PDFs show a clear message. Without pdfium.dll, the preview falls back to the Windows shell thumbnail of the first page when one is available. Files are read into memory, so a previewed PDF is never locked and can still be renamed or deleted.
  • Syntax-Highlighted Code & Text Previews: Read-only TSynEdit preview displaying the first 300 lines with line numbers and auto-detected syntax coloring for Pascal, Python, HTML/XML, CSS, JavaScript, JSON, SQL, Batch, INI, and Markdown.
  • Binary & Document File Cards: Displays the high-resolution Windows Shell icon (SHGetFileInfo), file metadata, and a 16-column Hex + ASCII byte peek of the file header.
  • "Open in Editor" Quick Action: One click jumps straight into the built-in Notepad editor tab.
  • Enable / Disable Toggle: Easily toggle live preview on or off with the search option checkbox.

📝 5. Windows 11 Notepad Replacement

A complete text and code editor powered by TSynEdit:

  • File Management: New, Open, Save, and Save As with dirty-tracking prompts so you never lose unsaved changes. Empty or blank files can also be created and saved directly.
  • Multi-Language Syntax Highlighting: Features 20 comprehensive syntax highlighters:
    • Pascal / Delphi / Free Pascal (.pas, .pp, .lpr, .inc, .dpr)
    • Python (.py, .pyw, .pyi)
    • JavaScript, TypeScript & JSON (.js, .jsx, .ts, .tsx, .json, .json5)
    • HTML & Web Templates (.html, .htm, .vue, .svelte, .twig)
    • XML & SVG (.xml, .svg, .xaml, .plist, .csproj, .config)
    • CSS & Stylesheets (.css, .scss, .sass, .less)
    • PHP (.php, .phtml)
    • C, C++, C# & Arduino (.c, .cpp, .h, .hpp, .cs, .ino)
    • Java, Kotlin & Groovy (.java, .kt, .kts, .gradle)
    • SQL & Databases (.sql, .ddl, .pgsql, .sqlite)
    • Windows Batch (.bat, .cmd)
    • INI, Config, YAML & TOML (.ini, .cfg, .conf, .toml, .yaml, .yml, .editorconfig)
    • Unix Shell Scripts (.sh, .bash, .zsh)
    • Perl (.pl, .pm)
    • Visual Basic (.vb, .vbs, .bas)
    • Unified Diff & Patches (.diff, .patch)
    • TeX & LaTeX (.tex, .ltx)
    • Lazarus / Delphi Forms (.lfm, .dfm)
    • Gettext PO Catalogs (.po, .pot)
    • Dedicated Custom Markdown Highlighter (.md, .markdown, .mdown) with real-time styling for headers, code blocks, lists, blockquotes, links, and bold/italic markup.
  • Full Keyboard & Editing Fidelity: Standard Backspace, Delete, Word-Backspace (Ctrl+Backspace), Select All (Ctrl+A), Undo / Redo (Ctrl+Z / Ctrl+Y), New (Ctrl+N), Open (Ctrl+O), Save (Ctrl+S), Save As (Ctrl+Shift+S), Close (Ctrl+W), Go to Line (Ctrl+G), and modern cursor navigation with immediate focus transfer on tab navigation.
  • Recent Files: File → Open Recent keeps the last 10 files you opened or saved.
  • Find & Replace Bar: Sleek slide-down search bar (Ctrl+F / Ctrl+H) with Find Next, Replace, Replace All, Case Sensitivity, and Whole Word matching. Enter finds the next match, Shift+Enter the previous one, F3 / Shift+F3 repeat the search with wrap-around, and Esc closes the bar.
  • Word Wrap & Formatting: Toggle Word Wrap on and off on the fly.
  • Text & HTML List Formatting: Format lines instantly as numbered or bulleted lists via toolbar buttons or context menu (Format):
    • Numbered List: Prefixes lines as an ordered list (1. Item, 2. Item), preserving blank lines and automatically stripping prior numbering/bullets so you can renumber or switch formats easily.
    • HTML Option & Unordered Bullet List: Toggle the HTML option to format lines with HTML tags (<ol><li>...</li></ol>) and reveal the Bullet List option for unordered lists (<ul><li>...</li></ul>).
    • Selection-Aware & Atomic Undo: When text is highlighted, formatting applies exclusively to the selected lines; when nothing is highlighted, the entire document is formatted. All format operations support atomic single-step undo (Ctrl+Z).
  • Smart Default File Name on Save: When saving an untitled file, the Save dialog automatically pre-fills a clean 8-character default filename extracted from the first line of text (filtering out Windows and Linux illegal filename characters such as \ / : * ? " < > |), saving user time while preserving full customization.
  • Instant Single-Instance File Opening via Windows Shell: Right-clicking any file in Windows Explorer and choosing "Open with Ace's Utilities", opening associated .txt/.md files, or passing file paths via command line while Ace's Utilities is already running seamlessly opens the file in the active Notepad editor. Powered by high-speed Win32 WM_COPYDATA IPC with window subclassing, elevation filters, automatic system tray unhiding, and dirty-tracking save prompts.
  • Dynamic Document Title Display: The main window title bar dynamically updates with the currently open document (Ace's Utilities - Filename.txt) and dirty flag indicator (Ace's Utilities - *Filename.txt), providing clear document visibility across the Windows taskbar and Alt+Tab switcher.
  • Status Bar: Live line number, column number, character count, UTF-8 indicator, and modified state tracker.

🌙 6. Native Windows 11 Dark Mode

  • Native DWM Titlebar: Integrates directly with Windows 11 Desktop Window Manager (DwmSetWindowAttribute via dwmapi.dll) for a true dark window frame.
  • Automatic System Detection: Detects your Windows theme preference (AppsUseLightTheme) on startup.
  • Dark Mode File Explorer, Results Lists & Grids: Folder trees (ShellTreeViewExplorer and ShellTreeView1) isolate tvoThemedDraw to prevent native Windows black font painting. File listings and grids (ShellListViewExplorer, lvResults, lvMemory, and lvContextMenu) use full custom-drawn items and subitems with high-contrast light silver text ($00F0F0F0 / $00D8D8D8) and deep slate row selections ($006B4D2B).
  • Subclassed Dark Column Titles & Headers: Parent ListView windows intercept Win32 SysHeader32 NM_CUSTOMDRAW notifications, rendering dark slate headers ($0025211E) with crisp light silver column titles ($00F0F0F0) and subtle column separators.
  • Full SynEdit Dark Gutter & Line Numbers: Gutter backgrounds, line numbers, active line highlights, separators, and code-folding parts deeply integrate with the dark palette, delivering high contrast and crystal-clear line number visibility across both the Notepad editor and Live Preview without washed-out light gutter panels.
  • Owner-Drawn Dark Status Bar: High-contrast light text ($00F0F0F0) and active lock indicator styling ($0050D0FF) across all panels, eliminating native Windows SysStatus32 black text on dark backgrounds. The bottom-right size grip (drag handle) is repainted dark, and the right-hand panels (Files, Dirs, CAPS, NUM, INS, clock) size correctly at any display scaling.
  • One-Click Toggle & Theme Cache Synchronization: Switch seamlessly between Dark and Light mode anytime via View → Dark Mode (Ctrl+Shift+D). The menu bar itself is custom drawn in Dark Mode. Dynamic custom-draw unhooking, WM_THEMECHANGED cache flushing, and transparent text backgrounds ensure zero stuck dark backgrounds or broken selection highlights when transitioning back to Light Mode.

📥 7. System Tray Integration

  • Run in System Tray: Turn on Tools → Run in System Tray to keep Ace's Utilities running quietly in your Windows notification area.
  • Minimize & Close to Tray: Minimizing or closing the window cleanly hides it to the tray.
  • Tray Context Menu: Right-click the tray icon for quick actions:
    • Open Ace's Utilities
    • Open Notepad
    • Exit
  • One-Click Restore: Left-clicking the tray icon restores the window to normal view immediately.
  • Persistent Setting: Preferences are saved across restarts in AceUtils.ini.

📑 8. Dynamic Tab Presentation & Styling

  • Multiple Tab Presentation Modes: Switch instantly between Classic Tabs, Modern Flat Buttons, and Push Buttons at runtime via View → Tab Style (or right-click the tab strip).
  • Active Tab Highlight Indicator: Optional dot indicator (●) clearly identifies the currently active notebook page.
  • Spacious / Modern Tab Height: Toggle between compact standard tab sizing and modern 28px touch/desktop tabs.
  • Instant Live Refresh: Seamless Win32 window recreation ensures visual style changes render immediately without requiring an application restart.
  • Persistent Preferences: Saves tab styles, heights, and indicator preferences across sessions in AceUtils.ini.

📋 9. Memory Management & Notes (Clipboard History & Scratchpad)

  • Configurable Manager Dropdown: Easily choose how many clipboard fragments to collect:
    • None: Manager is disabled; cuts and copies are not collected.
    • Last 5 memory (Default): Automatically retains the 5 most recent fragments.
    • Last 4 memory, Last 3 memory, Last 2 memory, or Only one: Keeps precisely the requested history depth.
  • Non-Blocking Clipboard Tracking: Uses Windows clipboard sequence monitoring (GetClipboardSequenceNumber) to detect system-wide cuts and copies without hooks, thread contention, or UI hangs.
  • One-Click Transfer to Notepad: Transfer any memory fragment or note directly into the Notepad tab (inserts at cursor, replaces selection, or appends). Automatically flags the document as unsaved (*Filename.txt or *Untitled Document and Modified status) so changes are never lost.
  • Persistent Quick Notes Scratchpad: A dedicated notes memo on the right side auto-saves directly to AceUtils_Notes.txt and reloads on startup.
  • Rich Context Menu & Actions: Right-click menu and toolbar buttons provide quick options to copy fragments back to the clipboard, append to Quick Notes, delete individual items, clear memory, or transfer to Notepad.

⌨️ 10. Menu Bar & Keyboard Shortcuts

A full File / Edit / View / Go / Tools / Help menu bar exposes every action. Shortcuts are context-aware: anything that doesn't apply to the current tab is disabled, so the key falls through to the control you're typing in. Help → Keyboard Shortcuts (F1) lists them all.

Shortcut Action
Ctrl+1 … Ctrl+6 The Real Explorer, File Search, Notepad, Memory & Notes, Context Menu, About
Ctrl+Tab / Ctrl+Shift+Tab Next / previous tab
Ctrl+F Find in Notepad · search the current folder from The Real Explorer
Ctrl+Shift+F Find files in the current folder
F5 Refresh Explorer · run the search · rescan context menu entries
Enter / Esc Start / stop a search (in any search field)
Ctrl+L Address bar
Alt+Left / Alt+Right / Alt+Up Back / forward / up one level
Ctrl+Shift+P Toggle the preview window for the current tab
Ctrl+Shift+D Toggle Dark Mode

Clipboard and undo keys (Ctrl+X/C/V/Z/Y/A) are deliberately not menu shortcuts. Native edit boxes and the editor handle them, so pasting into the Explorer address bar can never land in Notepad. The Edit menu's Cut / Copy / Paste items act on whichever control has focus.


🛠️ Visual Form Designer & Lazarus IDE Compatibility

Both forms are standard Lazarus Component Library (LCL) visual forms:

  • MainForm.lfm / MainForm.pas
  • PreviewForm.lfm / PreviewForm.pas

Every component, panel, gutter, and event handler is declared with standard published properties. You can open, visually modify, and save both forms directly in the Lazarus IDE Form Designer without errors.

🐧 Linux Compilation & Cross-Platform Support

Ace's Utilities is designed from the ground up to be compiled and run on Linux very easily:

  • Conditional Code Separation: All Windows-specific operations (such as Windows DWM dark titlebar composition via dwmapi.dll, Windows Shell file icons via SHGetFileInfo, and Explorer context menu registry integration) are strictly isolated with {$IFDEF WINDOWS} compiler directives.
  • Pure LCL & FPC: The file search engine, breadth-first directory walker, text encoding conversion (LazUTF8 / LConvEncoding), syntax highlighters, and GUI interfaces rely exclusively on the cross-platform Lazarus Component Library (LCL).
  • Multiple Linux Widgetsets: Compiles cleanly against GTK2, GTK3, Qt5, or Qt6 without requiring changes to source code.

Compiling on Linux in 3 Easy Steps

  1. Install Lazarus and FPC:
    bash
    # Debian / Ubuntu / Linux Mint
    sudo apt update && sudo apt install lazarus fpc
    
    # Fedora / RHEL
    sudo dnf install lazarus fpc
    
    # Arch Linux / Manjaro
    sudo pacman -S lazarus fpc
  2. Compile with lazbuild:
    bash
    lazbuild AceUtils.lpi
  3. Run:
    bash
    ./AceUtils

You can also open AceUtils.lpi in the Lazarus IDE on Linux and press F9 to compile and run immediately.


🚀 Building from Source

Prerequisites

  1. Lazarus IDE (version 2.2+ or 3.0+ / 4.0+) with Free Pascal Compiler (FPC 3.2.2+).
  2. SynEdit Package: Standard package bundled with Lazarus (located in lazarus/components/synedit).
  3. PDFium (optional, for PDF previews): Run powershell -ExecutionPolicy Bypass -File tools\fetch-pdfium.ps1. It downloads a pinned, checksum-verified 32-bit pdfium.dll from pdfium-binaries next to AceUtils.exe. Ship pdfium.dll alongside the executable. The app runs fine without it and simply falls back to thumbnails. License texts are in third_party/pdfium/. On Linux, install libpdfium.so next to the binary or on the library path.

Compile via Command Line

Windows (PowerShell), full clean release build:

powershell
# 1. Remove stale root unit files (FPC would otherwise link old object code)
Remove-Item -Force .\*.ppu, .\*.o -ErrorAction SilentlyContinue

# 2. Clean rebuild (32-bit i386-win32 with the default Lazarus install)
lazbuild -B AceUtils.lpi

# 3. Keep the alternate executable name in sync
Copy-Item -Force AceUtils.exe AceFileSearch.exe

# 4. First time only: fetch pdfium.dll for PDF previews
powershell -ExecutionPolicy Bypass -File tools\fetch-pdfium.ps1

To distribute, ship AceUtils.exe (or AceFileSearch.exe), pdfium.dll, and aceutils.ico together. AceUtils.ini and AceUtils_Notes.txt are created next to the executable on first run.

Linux (Bash / Zsh):

bash
lazbuild -B AceUtils.lpi

Run the Unit Tests

powershell
powershell -ExecutionPolicy Bypass -File tests\run-tests.ps1

On Linux run lazbuild -B tests/AceTests.lpi && tests/bin/AceTests --all --format=plain.

The script builds tests/AceTests.lpi (an fpcunit console runner), copies pdfium.dll next to it, and runs every test. It covers search patterns, path cleanup, list formatting, Explorer sort order, tab cycling, recent files, and real PDF rendering (page count, sizes, pixels, error codes, no file locking). The exit code is non-zero on any failure.

Compile via Lazarus IDE (Windows or Linux)

  1. Open Lazarus.
  2. Select Project -> Open Project... and choose AceUtils.lpi.
  3. Press F9 (or select Run -> Build).
  4. The compiled executable (AceUtils.exe on Windows, AceUtils on Linux) will be generated in the project root.

📄 License

MIT License. Created by TwilightSurfers.