Skip to content

Windows Platform Support

Windows-specific implementation details for Toss.

Windows supports multiple clipboard formats that need special handling:

  • CF_TEXT: ANSI text (legacy)
  • CF_UNICODETEXT: Unicode text (preferred)
  • CF_HDROP: File list (HDROP)
  • CF_DIB: Device-independent bitmap
  • CF_BITMAP: Bitmap handle

Implementation Status: Format constants and structure created in windows_formats.rs. Full implementation requires Windows API integration.

Files:

  • rust_core/src/clipboard/windows_formats.rs

Priority: Handle CF_UNICODETEXT for text, CF_HDROP for files, CF_DIB for images.

Prefer CF_UNICODETEXT over CF_TEXT:

// Use CF_UNICODETEXT for text
let format = ClipboardFormat::UnicodeText;

Handle CF_HDROP for file lists:

// Parse HDROP format
let files = parse_hdrop(data);

Support CF_DIB for images:

// Convert DIB to image format
let image = dib_to_image(data);
  • Credential Manager: Secure storage for device keys
  • System Tray: Taskbar integration
  • Notifications: Toast notifications

Toss includes production-level logging for Windows diagnostics:

Log TypePath
Application logs%LOCALAPPDATA%\toss\logs\toss.log
Panic/crash logs%LOCALAPPDATA%\toss\logs\panic.log

Windows GUI applications don’t show console output by default. To see Rust log output:

From Command Prompt (cmd.exe):

Terminal window
start /wait toss.exe

From PowerShell:

Terminal window
& .\toss.exe

PowerShell naturally waits for the process to complete.

When Toss encounters a crash (Rust panic), it will:

  1. Display a Windows MessageBox with crash details
  2. Write the panic information to panic.log
  3. Print to stderr (visible in console mode)

Go to Settings → About → Open Log Folder to quickly access the logs directory.

If the app doesn’t open or closes immediately:

  1. Run from command line with start /wait toss.exe
  2. Check %LOCALAPPDATA%\toss\logs\ for log files
  3. Look for panic.log for crash information