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.
Windows Icons
A simple Rust library to extract icons from files and running processes on Windows platforms.
Features
- Retrieve icons by file path or process id
- Request Explorer-aligned sizes (
Small16,Medium48,Large96,ExtraLarge256) - Save as a PNG or base64 encoded string
Installation
Add to your Cargo.toml:
[]
= "0.4.0"
Usage
use ;
// Get icon as an image from a file path
let icon = get_icon_by_path.unwrap;
icon.save.unwrap;
// Get icon at an Explorer-aligned size
let icon = get_icon_by_path_with_size.unwrap;
icon.save.unwrap;
// Get icon as a base64 string from a file path
let base64 = get_icon_base64_by_path.unwrap;
println!;
// Get icon as an image from dll
let folder = new.with_shell32;
let icon = get_icon_by_dll.unwrap;
icon.save.unwrap;
// Get icon as a base64 string frome dll
let explorer = new.with_explorer;
let base64 = get_icon_base64_by_dll.unwrap;
println!;
// Get icon as an image from a process ID
let process_id = 1234;
let icon = get_icon_by_process_id.unwrap;
icon.save.unwrap;
// Get icon as a base64 encoded string from a process ID
let base64 = get_icon_base64_by_process_id.unwrap;
println!;
For more examples, check the examples.
cargo run --example icon
cargo run --example process -- <process id>
cargo run --example dll
The process example is the easiest way to check a UWP app, since the install folder
under WindowsApps is not readable without elevation: start the app, then pass its
process id.
Requirements
This library is designed to work on Windows systems only.
License
This project is licensed under the MIT License - see the LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgements
This library uses the following crates:
imagefor image processingbase64for base64 encodingglobfor matching file pathswindowsfor Windows API interactions
Disclaimer
This library uses unsafe Rust code to interact with the Windows API. While efforts have been made to ensure safety, use it at your own risk.