#open-file #file-dialog #save #save-file #dialog #open #file

wfd

A simple to use abstraction over the Open and Save dialogs in the Windows API

7 releases

0.1.7 Jan 24, 2021
0.1.6 Dec 10, 2020
0.1.4 Jul 21, 2020
0.1.3 Nov 18, 2019

#59 in Windows APIs

Download history 4077/week @ 2024-06-07 4938/week @ 2024-06-14 3134/week @ 2024-06-21 6117/week @ 2024-06-28 5758/week @ 2024-07-05 6835/week @ 2024-07-12 6380/week @ 2024-07-19 7173/week @ 2024-07-26 6422/week @ 2024-08-02 6514/week @ 2024-08-09 8502/week @ 2024-08-16 10324/week @ 2024-08-23 9799/week @ 2024-08-30 6418/week @ 2024-09-06 5077/week @ 2024-09-13 2965/week @ 2024-09-20

26,300 downloads per month
Used in 41 crates (2 directly)

MIT license

25KB
308 lines

wfd

Build Status Crates.io License: 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

let dialog_result = wfd::open_dialog(Default::default())?;

Folder picker open dialog

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

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

Dependencies

~1–270KB