Read this in other languages: English | 中文
Wincent is a rust library for managing Windows quick access functionality, providing comprehensive control over your file system's quick access content.
- 🔍 Query Quick Access Contents
- ➕ Add Items to Quick Access
- 🗑️ Remove Specific Quick Access Entries
- 🧹 Clear Quick Access Items
- 👁️ Toggle Visibility of Quick Access Items
Add the following to your Cargo.toml
:
[dependencies]
wincent = "0.1.1"
- The implementation of features is highly dependent on system APIs. Windows may tighten related permissions or calls for security reasons, which may lead to failure.
- The personal system environment may differ from the testing environment, resulting in the functionality not working properly. The author has observed similar issues, likely due to certain software modifying related registry entries. The specific registry items have not been identified. Before use, you can call related functions to check if they are feasible, mainly concerning folder operations.
- The visibility section will modify the registry, which may lead to unexpected results. The window layout is likely to be affected, so please use it with caution.
use wincent::{
feasible::{check_script_feasible, fix_script_feasible},
query::get_quick_access_items,
error::WincentError
};
fn main() -> Result<(), WincentError> {
// Check if quick access is feasible
if !check_script_feasible()? {
println!("Fixing script execution policy...");
fix_script_feasible()?;
}
// List all current quick access items
let quick_access_items = get_quick_access_items()?;
for item in quick_access_items {
println!("Quick Access item: {}", item);
}
Ok(())
}
use wincent::{
query::get_recent_files,
handle::remove_from_recent_files,
error::WincentError
};
fn main() -> Result<(), WincentError> {
// Remove sensitive files from recent items
let recent_files = get_recent_files()?;
for item in recent_files {
if item.contains("password") {
remove_from_recent_files(&item)?;
}
}
Ok(())
}
use wincent::{
visible::{is_recent_files_visiable, set_recent_files_visiable},
error::WincentError
};
fn main() -> Result<(), WincentError> {
let is_visible = is_recent_files_visiable()?;
println!("Recent files visibility: {}", is_visible);
set_recent_files_visiable(!is_visible)?;
println!("Visibility toggled");
Ok(())
}
The library uses Rust's Result
type for comprehensive error management, allowing precise handling of potential issues during quick access manipulation.
- Supports Windows 10 and Windows 11
- Requires Rust 1.60.0 or later
- Fork the repository
- Create your feature branch (
git checkout -b wincent/amazing-feature
) - Commit your changes (
git commit -m 'feat: Add some amazing feature'
) - Push to the branch (
git push origin wincent/amazing-feature
) - Open a Pull Request
# Clone the repository
git clone https://github.com/Hellager/wincent-rs.git
cd wincent-rs
# Install development dependencies
cargo build
cargo test
This library interacts with system-level Quick Access functionality. Always ensure you have appropriate permissions and create backups before making significant changes.
If you encounter any issues or have questions, please file an issue on our GitHub repository.
Distributed under the MIT License. See LICENSE
for more information.
Developed with 🦀 by @Hellager