How sxzxs/explore_select_items works
Project type and purpose
• This is a Windows Explorer extension (a system‐level utility) written in AutoHotkey (AHK) that provides pinyin (and wubi) based filtering/search of Explorer items.
• The main deliverable is an AHK script (资源管理器拼音搜索.ahk) and a compiled EXE (资源管理器拼音搜索.exe) that hooks into Explorer, captures keystrokes, queries the file/folder list, applies pinyin matching, and renders a custom UI overlay.
File structure
Top-level:
• README.md / README.html – project description and usage
• 资源管理器拼音搜索.ahk & .exe – the main entrypoint (script + compiled binary)
• back/资源管理器拼音搜索.ahk – backup or alternate version
• config/settings.json – user‐tweakable settings (e.g., hotkeys, filter modes)
• lib/ – a collection of AHK libraries and DLLs:
– IbPinyin.ahk/IbPinyin_v2.ahk – pinyin conversion & matching
– wubi.ahk – 86 五笔 input support
– json.ahk – JSON read/write for config
– Gdip_All.ahk – GDI+ UI rendering
– log.ahk, NonNull.ahk – utility helpers
– dll_32 / dll_64 – native binaries for GDI+ or other hooks
• test.ahk – standalone test harness for development
README for additional insights
• Explains features: supports initial letters, full pinyin, double‐拼, wubi.
• Describes usage: right-click admin to run EXE or AHK; then when in Explorer, type and filter; Tab/Shift+Tab for navigation; Enter to enter directory.
Main components & their interactions
a. Windows Explorer (Host)
• Explorer window where user invokes the extension (via right-click or hotkey).
b. Extension Process (AHK Script / EXE)
• Registers keyboard hooks or shell hooks to monitor keystrokes in Explorer.
• On activation, enumerates the current Explorer item list.
• Loads config/settings.json via json.ahk.
• Routes raw keystrokes to filter logic.
c. Matching Engine
• Uses IbPinyin(.ahk), IbPinyin_v2.ahk for pinyin decomposition, wubi.ahk for wubi schemes.
• Applies filter rules (first‐letter, full pinyin, double pinyin).
d. UI Renderer
e. Utilities & Helpers
• log.ahk for debug logging
• NonNull.ahk for safe variable handling
f. Test Harness
• test.ahk for offline testing of matching logic
Data flows:
Explorer → (hook) → AHK Extension → read settings → enumerate items → matching engine → UI renderer → user
AHK Extension ↔ Libraries (pinyin, JSON, GDI+)
AHK Extension → config/settings.json
Architectural patterns & design principles
• Modular scripting: core logic separated from libraries and config
• Single‐process, event‐driven model—AHK listens for key events, reacts, and renders
• External dependency isolation: JSON and GDI+ functionality are factored into reusable libs