https://github.com/ben-wallis/wfd
Windows Open and Save dialogs in Rust using winapi
https://github.com/ben-wallis/wfd
dialogs rust win32 windows
Last synced: 25 days ago
JSON representation
Windows Open and Save dialogs in Rust using winapi
- Host: GitHub
- URL: https://github.com/ben-wallis/wfd
- Owner: ben-wallis
- License: mit
- Created: 2019-10-24T17:39:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-10-03T18:47:58.000Z (7 months ago)
- Last Synced: 2025-12-20T20:30:45.168Z (4 months ago)
- Topics: dialogs, rust, win32, windows
- Language: Rust
- Homepage:
- Size: 1.74 MB
- Stars: 21
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wfd
[](https://github.com/ben-wallis/wfd/actions)
[](https://crates.io/crates/wfd)
[](https://opensource.org/licenses/MIT)
This crate provides a simple to use abstraction over the Open and Save dialogs in the Windows API, usable under both GNU and MSVC toolchains, with minimal dependencies.
## Examples
### Standard open dialog
```rust
let dialog_result = wfd::open_dialog(Default::default())?;
```
### Folder picker open dialog
```rust
use wfd::{DialogParams};
let params = DialogParams {
options: FOS_PICKFOLDERS,
.. Default::default()
};
let dialog_result = wfd::open_dialog(params)?;
```
### Save dialog with custom file extension filters
```rust
use wfd::{DialogParams};
let params = DialogParams {
title: "Select an image to open",
file_types: vec![("JPG Files", "*.jpg;*.jpeg"), ("PNG Files", "*.png"), ("Bitmap Files", "*.bmp")],
default_extension: "jpg",
..Default::default()
};
let dialog_result = wfd::save_dialog(params)?;
```
**Further examples can be found in `src\examples`**