How alexanderpro/wlx2explorer works
Purpose and Runtime
Wlx2Explorer is a Windows/.NET Framework 4.0 desktop utility that hosts Total Commander WLX lister plugins for files selected in File Explorer or on the Desktop. It also supports direct file launching through CLI arguments. The application is a WinForms executable built by Wlx2Explorer/Wlx2Explorer.csproj.
Startup and Invocation Paths
Wlx2Explorer/Program.cs is the process entry point. It interprets CLI options such as --file and --suppressmsg, then starts the application workflow. Wlx2Explorer/StartUpManager.cs centralizes startup behavior, likely choosing between command-line file handling and interactive Explorer/Desktop selection. Wlx2Explorer/ToggleParser.cs provides command-line switch parsing.
Global Hotkey and Shell Selection
The primary interactive path is a global Ctrl+Q keyboard shortcut captured by Wlx2Explorer/Hooks/KeyboardHook.cs, with key definitions in Wlx2Explorer/Hooks/VirtualKey.cs and Wlx2Explorer/Hooks/VirtualKeyModifier.cs. On activation, the application queries the active Windows shell context to identify the selected file. Shell/COM interop boundaries are represented by Wlx2Explorer/Native/NativeMethods.cs, Wlx2Explorer/Native/Interfaces/IShellBrowser.cs, and Wlx2Explorer/Native/Interfaces/IServiceProvider.cs.
Plugin Discovery and Hosting
Wlx2Explorer/Plugin.cs is the core abstraction for configured Total Commander lister plugins and their loading/use lifecycle. Plugin metadata and persisted definitions are modeled in Wlx2Explorer/Settings/PluginInfo.cs. The viewer UI is hosted in Wlx2Explorer/Forms/ListerForm.cs, which is the boundary between managed WinForms controls and plugin-provided viewer behavior.
User Interface and Control Flow
Wlx2Explorer/Forms/MainForm.cs is the main application UI and likely coordinates plugin selection, settings access, and viewer launch. Wlx2Explorer/Forms/ListerForm.cs displays a selected file through the chosen plugin. Search and selection workflows are isolated in Wlx2Explorer/Forms/SearchForm.cs; application messages use Wlx2Explorer/Forms/MessageBoxForm.cs. Form designer/resource files define the corresponding WinForms layouts.
Configuration and Persistence
The application uses two repo-distributed configuration formats: Wlx2Explorer/Wlx2Explorer.xml for application settings and Wlx2Explorer/Wlx2Explorer.ini for plugin settings. Wlx2Explorer/InitializationFile.cs encapsulates INI access. Program-level settings are modeled by Wlx2Explorer/Settings/ProgramSettings.cs, while generated .NET settings remain in Wlx2Explorer/Properties/Settings.settings.
Windows Integration Boundaries
The code depends on native Windows APIs, Shell COM interfaces, global keyboard hooks, and window-handle interoperability rather than external network services. Wlx2Explorer/Native/NativeTypes.cs and Wlx2Explorer/Native/NativeConstants.cs define interop contracts; Wlx2Explorer/Win32WindowWrapper.cs and Wlx2Explorer/Utils/WindowUtils.cs adapt native windows/handles for managed UI hosting. This boundary is critical because plugins and Explorer selection operate outside the managed application process model.
Main entry points: MainForm.cs Main window · StartUpManager.cs Startup manager · Program.cs Process entry point · Plugin.cs WLX plugin lifecycle
Components 18
Startup
- WinForms executable · .NET Framework 4.0 application build.
Wlx2Explorer/Wlx2Explorer.csproj - Process entry point
Wlx2Explorer/Program.cs - Startup manager · Chooses command-line or interactive invocation.
Wlx2Explorer/StartUpManager.cs - CLI parser · Parses --file and --suppressmsg switches.
Wlx2Explorer/ToggleParser.cs
WinForms UI
- Main window · Coordinates plugin selection and viewer launch.
Wlx2Explorer/Forms/MainForm.cs - Search workflow
Wlx2Explorer/Forms/SearchForm.cs - Application messages
Wlx2Explorer/Forms/MessageBoxForm.cs
Plugin Hosting
- Lister viewer · Hosts the selected plugin viewer for a file.
Wlx2Explorer/Forms/ListerForm.cs - WLX plugin lifecycle · Loads and uses configured Total Commander lister plugins.
Wlx2Explorer/Plugin.cs - Plugin definitions
Wlx2Explorer/Settings/PluginInfo.cs
Windows Integration
- Global Ctrl+Q hook · Triggers interactive file viewing.
Wlx2Explorer/Hooks/KeyboardHook.cs - Explorer selection · Queries the active shell context for the selected file.
Wlx2Explorer/Native/Interfaces/IShellBrowser.cs - Native API bridge
Wlx2Explorer/Native/NativeMethods.cs - Window-handle adapter · Adapts native plugin windows to managed UI hosting.
Wlx2Explorer/Win32WindowWrapper.cs
Configuration
- Program settings
Wlx2Explorer/Settings/ProgramSettings.cs - Application settings XML
Wlx2Explorer/Wlx2Explorer.xml - Plugin settings INI
Wlx2Explorer/Wlx2Explorer.ini - INI access
Wlx2Explorer/InitializationFile.cs
Connections 18
- WinForms executable → Process entry point: builds
- Process entry point → CLI parser: parses arguments
- Process entry point → Startup manager: starts
- Startup manager → Main window: interactive UI
- Startup manager → Lister viewer: CLI file launch
- Global Ctrl+Q hook → Explorer selection: on Ctrl+Q
- Explorer selection → Main window: selected file
- Main window → Search workflow: opens
- Main window → Lister viewer: launches viewer
- Main window → Application messages: shows messages
- Lister viewer → WLX plugin lifecycle: hosts
- WLX plugin lifecycle → Window-handle adapter: plugin window
- Window-handle adapter → Native API bridge: uses Win32 handles
- WLX plugin lifecycle → Plugin definitions: uses definitions
- Plugin definitions → INI access: persists through
- INI access → Plugin settings INI: reads and writes
- Startup manager → Program settings: loads settings
- Program settings → Application settings XML: stored in