docs.rs failed to build win-context-menu-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
win-context-menu-0.1.4
win-context-menu
Show and interact with Windows Explorer context menus programmatically from Rust.
Features
- Display native Windows shell context menus for files and folders
- Support for single file, multi-select, and folder background menus
- Extended menu support (Shift+right-click equivalent)
- Enumerate menu items without displaying the menu
- Execute selected commands
- Full submenu support via
IContextMenu2/IContextMenu3 - Optional C FFI layer for use from other languages (Electron, C#, C++, etc.)
- Optional serde support for menu item serialization
Quick Start
use ;
Builder API
use ;
Enumerate Menu Items
use ;
FFI (C / C++ / Electron)
Enable the ffi feature to expose C-compatible functions:
[]
= { = "0.1", = ["ffi"] }
C usage example
// Opaque types
typedef struct FfiComGuard FfiComGuard;
typedef struct FfiSelectedItem;
// Functions exported by win-context-menu
FfiComGuard* ;
void ;
FfiSelectedItem* ;
void ;
char* ;
void ;
const char* ; // thread-local error message
int
Threading
All operations require COM to be initialized in single-threaded apartment (STA) mode. Call init_com() once per thread and keep the returned ComGuard alive. Do not move the guard to another thread.
Feature Flags
| Feature | Description |
|---|---|
ffi |
Enable C-compatible FFI exports (adds serde_json dependency) |
serde |
Derive Serialize / Deserialize for MenuItem |
tracing |
(reserved for future use) |
Requirements
- Windows 10 or later
- Rust 1.80+ (2021 edition)
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.