Skip to content

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

  • IThumbnailProvider for thumbnail extraction
  • IInitializeWithStream for stream-based archive access
  • IQueryInfo for tooltip metadata

Legacy interfaces are retained for compatibility:

  • IPersistFile
  • IExtractImage2

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: zip crate
  • Rar: unrar crate
  • 7z: sevenz-rust crate

Image processing

  • Hybrid decode pipeline:
    • Primary: Windows WIC decoder (uses OS codecs, optional modern codec support)
    • Fallback: Rust image crate 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.