How ql-win/quicklook works
Purpose and entry points
QuickLook is a Windows desktop utility that opens an instant preview for the selected file, principally through Space and keyboard navigation. The primary executable is a WPF application initialized by QuickLook/App.xaml and QuickLook/App.xaml.cs; its project is QuickLook/QuickLook.csproj. The preview surface is QuickLook/ViewerWindow.xaml with behavior split across QuickLook/ViewerWindow.xaml.cs and action/property partials.
Application orchestration
The resident application owns tray presence, input activation, preview-window lifetime, and interprocess coordination:
• QuickLook/TrayIconManager.cs and QuickLook/TrayIconWindow.cs expose the background/tray control surface.
• QuickLook/FocusMonitor.cs, QuickLook/KeystrokeDispatcher.cs, and QuickLook/Helpers/GlobalKeyboardHook.cs detect selection/focus context and route keyboard commands.
• QuickLook/ViewWindowManager.cs creates, reuses, closes, and navigates viewer windows.
• QuickLook/PipeServerManager.cs is a process boundary for commands forwarded to the running instance.
Control flow is selection/context → key or forwarded command → view-window manager → plugin selection/rendering → viewer UI. The app also includes startup, update, shell, and sharing integration under QuickLook/Helpers/AutoStartupHelper.cs, QuickLook/Helpers/Updater.cs, and QuickLook/Helpers/ShareHelper.cs.
Plugin contract and loading boundary
The extensibility boundary is defined in the shared .NET library:
• QuickLook.Common/Plugin/IViewer.cs
• QuickLook.Common/Plugin/ContextObject.cs
• QuickLook.Common/Plugin/MoreMenu/IMoreMenu.cs
QuickLook/PluginManager.cs discovers and manages viewer implementations; QuickLook.Common/Helpers/PluginHelper.cs supports plugin operations. A viewer receives file/context information, determines support, and supplies a UI control and optional “More” menu actions. This isolates format-specific parsing/rendering from the host window and permits separately installed .qlplugin packages.
Built-in viewer families
The repository ships many viewer assemblies, each conventionally rooted at a Plugin.cs implementation and project file. Architecture-defining families include:
• General images and animations: QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml, QuickLook.Plugin/QuickLook.Plugin.ImageViewer/AnimatedImage/AnimatedImage.cs.
• Text/source inspection and syntax classification: QuickLook.Plugin/QuickLook.Plugin.TextViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.TextViewer/TextViewerPanel.cs, QuickLook.Plugin/QuickLook.Plugin.TextViewer/Detectors/FormatDetector.cs.
• Archive/package metadata and file listing: QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/ArchiveFileListView.xaml, QuickLook.Plugin/QuickLook.Plugin.AppViewer/Plugin.cs.
• Document/media viewers: QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.VideoViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.MarkdownViewer/Plugin.cs.
• Binary/system-format inspection: QuickLook.Plugin/QuickLook.Plugin.PEViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.ELFViewer/Plugin.cs, QuickLook.Plugin/QuickLook.Plugin.DumpViewer/Plugin.cs.
Platform and rendering boundaries
The app is Windows-specific and combines managed WPF/XAML with Win32 and native C++. Managed interop is centralized in QuickLook/NativeMethods/QuickLook.cs, QuickLook/NativeMethods/User32.cs, and QuickLook.Common/NativeMethods/Dwmapi.cs; this supports shell/window behavior and Fluent-like visual integration. Several viewers embed web-rendered content or use browser assets, notably QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/WebpagePanel.cs, QuickLook.Plugin/QuickLook.Plugin.MarkdownViewer/MarkdownPanel.cs, and QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Webview/WebHandler.cs.
Native DLL projects provide hooks/integration for Explorer dialogs and third-party file managers across x86, x64, and ARM64: QuickLook.Native/QuickLook.Native32/QuickLook.Native32.vcxproj, QuickLook.Native/QuickLook.Native32/DialogHook.cpp, and QuickLook.Native/QuickLook.WoW64HookHelper/QuickLook.WoW64HookHelper.cpp.
Distribution and deployment
The solution is QuickLook.slnx, comprising C# WPF projects and Visual C++ native projects. It supports three deployment forms: unpackaged installer via WiX (QuickLook.Installer/Product.wxs), MSIX/AppX via QuickLook.Appx/QuickLook.Appx.wapproj and QuickLook.Appx/Package.appxmanifest, and scripted release archives/installers under Scripts/pack-all.ps1, Scripts/pack-appx.ps1, and Scripts/pack-setup.ps1. GitHub Actions builds through .github/workflows/msbuild.yml.
Main entry points: PluginManager.cs Plugin manager · IViewer.cs Viewer contracts · App.xaml WPF application · QuickLook.slnx Solution build
Components 20
Desktop host
Resident WPF application and preview lifecycle.
- WPF application · Initializes the resident QuickLook process.
QuickLook/App.xaml - Tray control · Provides the background control surface.
QuickLook/TrayIconManager.cs - Selection & key input · Detects context and dispatches preview commands.
QuickLook/FocusMonitor.cs - Command pipe · Forwards commands to the running instance.
QuickLook/PipeServerManager.cs - Viewer window manager · Creates, reuses, closes, and navigates preview windows.
QuickLook/ViewWindowManager.cs - Preview surface · Hosts selected viewer controls and actions.
QuickLook/ViewerWindow.xaml
Plugin system
Shared contracts, loading, and built-in viewers.
- Viewer contracts · Defines viewer context and optional More-menu extensions.
QuickLook.Common/Plugin/IViewer.cs - Plugin manager · Discovers and selects installed viewer implementations.
QuickLook/PluginManager.cs - Image & animation viewer
QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Plugin.cs - Text & source viewer · Classifies formats for source inspection.
QuickLook.Plugin/QuickLook.Plugin.TextViewer/Plugin.cs - Archive & app viewers · Lists package and archive contents.
QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/Plugin.cs - Document & media viewers · Includes PDF, video, and Markdown previews.
QuickLook.Plugin/QuickLook.Plugin.PDFViewer/Plugin.cs - Binary format viewers · Inspects PE, ELF, and dump files.
QuickLook.Plugin/QuickLook.Plugin.PEViewer/Plugin.cs - Web-rendered viewers · Renders HTML, Markdown, and image web content.
QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/WebpagePanel.cs
Windows integration
Managed interop and native Explorer hooks.
- Managed Win32 interop · Supports shell, window, and visual integration.
QuickLook/NativeMethods/QuickLook.cs - Explorer dialog hooks · Integrates Explorer dialogs and third-party file managers across architectures.
QuickLook.Native/QuickLook.Native32/DialogHook.cpp
Build & delivery
Solution build and deployment outputs.
- Solution build · Builds C# WPF and Visual C++ projects.
QuickLook.slnx - Installer package · Produces the unpackaged installer.
QuickLook.Installer/Product.wxs - MSIX package · Produces the packaged Windows deployment.
QuickLook.Appx/QuickLook.Appx.wapproj - Release packaging · Builds release archives and installers.
Scripts/pack-all.ps1
Connections 27
- WPF application → Tray control: owns
- WPF application → Selection & key input: starts
- WPF application → Command pipe: hosts
- Selection & key input → Viewer window manager: preview command
- Command pipe → Viewer window manager: forwarded command
- Viewer window manager → Plugin manager: selects viewer
- Viewer window manager → Preview surface: manages
- Plugin manager → Viewer contracts: uses API
- Image & animation viewer → Viewer contracts: implements
- Text & source viewer → Viewer contracts: implements
- Archive & app viewers → Viewer contracts: implements
- Document & media viewers → Viewer contracts: implements
- Binary format viewers → Viewer contracts: implements
- Plugin manager → Image & animation viewer: loads
- Plugin manager → Text & source viewer: loads
- Plugin manager → Archive & app viewers: loads
- Plugin manager → Document & media viewers: loads
- Plugin manager → Binary format viewers: loads
- Document & media viewers → Web-rendered viewers: renders through
- Preview surface → Managed Win32 interop: window and shell calls
- Explorer dialog hooks → WPF application: native integration
- Solution build → WPF application: builds
- Solution build → Explorer dialog hooks: builds
- Solution build → Installer package: packages
- Solution build → MSIX package: packages
- Release packaging → Installer package: assembles
- Release packaging → MSIX package: assembles