Architecture
Quick answer
- Core APIs:
IThumbnailProvider,IInitializeWithStream,IQueryInfo - Archive layer: Trait-based ZIP/RAR/7z adapters
- Image pipeline:
image+fast_image_resize, outputs HBITMAP for Explorer
CBXShell implements modern Windows shell extension interfaces and a trait-based archive layer for ZIP, RAR, and 7z formats.
COM implementation
IThumbnailProviderfor thumbnail extractionIInitializeWithStreamfor stream-based archive accessIQueryInfofor tooltip metadata
Legacy interfaces are retained for compatibility:
IPersistFileIExtractImage2
Archive support
The archive layer exposes a unified trait API:
pub trait Archive: Send { fn find_first_image(&mut self, sort: bool) -> Result<ArchiveEntry>; fn extract_to_memory(&mut self, entry: &ArchiveEntry) -> Result<Vec<u8>>; fn get_info(&self) -> Result<ArchiveInfo>;}Implementations:
- Zip:
zipcrate - Rar:
unrarcrate - 7z:
sevenz-rustcrate
Image processing
- Hybrid decode pipeline:
- Primary: Windows WIC decoder (uses OS codecs, optional modern codec support)
- Fallback: Rust
imagecrate decoder
- WebP, AVIF, JPEG, PNG, GIF, BMP, TIFF, ICO (availability depends on OS codec installation for WIC path)
- High-quality resize via
fast_image_resize(Lanczos3) - HBITMAP generation for Explorer integration
Why WIC-first?
- Keeps binary size smaller compared to bundling full external codec stacks.
- Lets CBXShell benefit from platform codec updates (for example AVIF support through installed Windows codecs).
- Maintains compatibility through automatic fallback when WIC decode is unavailable or fails.