# alexanderpro/wlx2explorer architecture

> Architecture diagram of the GitHub repository alexanderpro/wlx2explorer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alexanderpro/wlx2explorer
- Repository: https://github.com/alexanderpro/wlx2explorer

## Overview

#### 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: [`Wlx2Explorer/Forms/MainForm.cs`](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/MainForm.cs) (Main window), [`Wlx2Explorer/StartUpManager.cs`](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/StartUpManager.cs) (Startup manager), [`Wlx2Explorer/Program.cs`](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Program.cs) (Process entry point), [`Wlx2Explorer/Plugin.cs`](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Plugin.cs) (WLX plugin lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup"]
  node_project["WinForms executable"]
  node_program["Process entry point<br/>startup<br/>[Program.cs]"]
  node_startup_manager["Startup manager<br/>workflow<br/>[StartUpManager.cs]"]
  node_toggle_parser["CLI parser<br/>argument parsing<br/>[ToggleParser.cs]"]
end

subgraph group_ui["WinForms UI"]
  node_main_form["Main window<br/>WinForms form<br/>[MainForm.cs]"]
  node_search_form["Search workflow<br/>WinForms form<br/>[SearchForm.cs]"]
  node_message_form["Application messages<br/>WinForms form<br/>[MessageBoxForm.cs]"]
end

subgraph group_plugins["Plugin Hosting"]
  node_lister_form["Lister viewer<br/>WinForms host<br/>[ListerForm.cs]"]
  node_plugin{{"WLX plugin lifecycle<br/>plugin abstraction<br/>[Plugin.cs]"}}
  node_plugin_info["Plugin definitions<br/>settings model<br/>[PluginInfo.cs]"]
end

subgraph group_windows["Windows Integration"]
  node_keyboard_hook{{"Global Ctrl+Q hook<br/>keyboard hook<br/>[KeyboardHook.cs]"}}
  node_shell_interop{{"Explorer selection<br/>Shell COM interop<br/>[IShellBrowser.cs]"}}
  node_native_methods["Native API bridge<br/>Win32 interop<br/>[NativeMethods.cs]"]
  node_window_hosting["Window-handle adapter<br/>native UI adapter"]
end

subgraph group_settings["Configuration"]
  node_program_settings["Program settings<br/>settings model<br/>[ProgramSettings.cs]"]
  node_app_xml["Application settings XML<br/>configuration file<br/>[Wlx2Explorer.xml]"]
  node_plugin_ini["Plugin settings INI<br/>configuration file<br/>[Wlx2Explorer.ini]"]
  node_ini_access["INI access<br/>persistence adapter"]
end

node_project -->|"builds"| node_program
node_program -->|"parses arguments"| node_toggle_parser
node_program -->|"starts"| node_startup_manager
node_startup_manager -->|"interactive UI"| node_main_form
node_startup_manager -->|"CLI file launch"| node_lister_form
node_keyboard_hook -->|"on Ctrl+Q"| node_shell_interop
node_shell_interop -->|"selected file"| node_main_form
node_main_form -->|"opens"| node_search_form
node_main_form -->|"launches viewer"| node_lister_form
node_main_form -->|"shows messages"| node_message_form
node_lister_form -->|"hosts"| node_plugin
node_plugin -->|"plugin window"| node_window_hosting
node_window_hosting -->|"uses Win32 handles"| node_native_methods
node_plugin -->|"uses definitions"| node_plugin_info
node_plugin_info -->|"persists through"| node_ini_access
node_ini_access -->|"reads and writes"| node_plugin_ini
node_startup_manager -->|"loads settings"| node_program_settings
node_program_settings -->|"stored in"| node_app_xml

click node_project "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.csproj"
click node_program "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Program.cs"
click node_startup_manager "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/StartUpManager.cs"
click node_toggle_parser "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/ToggleParser.cs"
click node_main_form "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/MainForm.cs"
click node_search_form "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/SearchForm.cs"
click node_message_form "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/MessageBoxForm.cs"
click node_lister_form "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/ListerForm.cs"
click node_plugin "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Plugin.cs"
click node_plugin_info "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Settings/PluginInfo.cs"
click node_keyboard_hook "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Hooks/KeyboardHook.cs"
click node_shell_interop "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Native/Interfaces/IShellBrowser.cs"
click node_native_methods "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Native/NativeMethods.cs"
click node_window_hosting "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Win32WindowWrapper.cs"
click node_program_settings "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Settings/ProgramSettings.cs"
click node_app_xml "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.xml"
click node_plugin_ini "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.ini"
click node_ini_access "https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/InitializationFile.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_project,node_program,node_startup_manager,node_toggle_parser toneBlue
class node_main_form,node_search_form,node_message_form toneAmber
class node_lister_form,node_plugin,node_plugin_info toneMint
class node_keyboard_hook,node_shell_interop,node_native_methods,node_window_hosting toneRose
class node_program_settings,node_app_xml,node_plugin_ini,node_ini_access toneIndigo
```

## Components

### Startup

- [WinForms executable](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.csproj): project · .NET Framework 4.0 application build. · `Wlx2Explorer/Wlx2Explorer.csproj`
- [Process entry point](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Program.cs): startup · `Wlx2Explorer/Program.cs`
- [Startup manager](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/StartUpManager.cs): workflow · Chooses command-line or interactive invocation. · `Wlx2Explorer/StartUpManager.cs`
- [CLI parser](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/ToggleParser.cs): argument parsing · Parses --file and --suppressmsg switches. · `Wlx2Explorer/ToggleParser.cs`

### WinForms UI

- [Main window](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/MainForm.cs): WinForms form · Coordinates plugin selection and viewer launch. · `Wlx2Explorer/Forms/MainForm.cs`
- [Search workflow](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/SearchForm.cs): WinForms form · `Wlx2Explorer/Forms/SearchForm.cs`
- [Application messages](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/MessageBoxForm.cs): WinForms form · `Wlx2Explorer/Forms/MessageBoxForm.cs`

### Plugin Hosting

- [Lister viewer](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Forms/ListerForm.cs): WinForms host · Hosts the selected plugin viewer for a file. · `Wlx2Explorer/Forms/ListerForm.cs`
- [WLX plugin lifecycle](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Plugin.cs): plugin abstraction · Loads and uses configured Total Commander lister plugins. · `Wlx2Explorer/Plugin.cs`
- [Plugin definitions](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Settings/PluginInfo.cs): settings model · `Wlx2Explorer/Settings/PluginInfo.cs`

### Windows Integration

- [Global Ctrl+Q hook](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Hooks/KeyboardHook.cs): keyboard hook · Triggers interactive file viewing. · `Wlx2Explorer/Hooks/KeyboardHook.cs`
- [Explorer selection](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Native/Interfaces/IShellBrowser.cs): Shell COM interop · Queries the active shell context for the selected file. · `Wlx2Explorer/Native/Interfaces/IShellBrowser.cs`
- [Native API bridge](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Native/NativeMethods.cs): Win32 interop · `Wlx2Explorer/Native/NativeMethods.cs`
- [Window-handle adapter](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Win32WindowWrapper.cs): native UI adapter · Adapts native plugin windows to managed UI hosting. · `Wlx2Explorer/Win32WindowWrapper.cs`

### Configuration

- [Program settings](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Settings/ProgramSettings.cs): settings model · `Wlx2Explorer/Settings/ProgramSettings.cs`
- [Application settings XML](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.xml): configuration file · `Wlx2Explorer/Wlx2Explorer.xml`
- [Plugin settings INI](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/Wlx2Explorer.ini): configuration file · `Wlx2Explorer/Wlx2Explorer.ini`
- [INI access](https://github.com/alexanderpro/wlx2explorer/blob/master/Wlx2Explorer/InitializationFile.cs): persistence adapter · `Wlx2Explorer/InitializationFile.cs`

## Connections

- 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
