JFLib

plat/win_filedlg.rs (Windows)#

Source: lib/plat/win_filedlg.rs

win_filedlg -- the system Open / Save dialog (comdlg32 + ole32, loaded at run time)
                                                              [src/plat/win/win_filedlg.s]

  file_dialog(flags, path, exts) -> (1 chosen / 0 cancelled / -1 no system dialog, index of
       the chosen extension entry)
       flags: FD_SAVE (bit 0), initial extension index in bits 8..15 (FD_EXT_SHIFT);
       FD_FOLDER answers -1 (the library's own dialog chooses folders); FD_MULTI (open):
       OFN_ALLOWMULTISELECT, every chosen file in file_dialog_paths(), path the first.
       path (UTF-8): initial file / folder in, chosen path out ('/' separators).
       exts: ["png=PNG-Bild", "jpg;jpeg=JPEG-Bild"] (extensions separated by ';', the first
       is the default, optional "=description"), empty = all.
  file_dialog_filter(flags, exts) -> (filter, default extension)   the dialog's filter list
       ("description\0pattern\0...\0\0", UTF-16) -- for tests

GetOpenFileNameW / GetSaveFileNameW without hooks show the Explorer dialog of the system
(Common Item Dialog); the call is modal and blocks until the user is done (the window
procedures of our windows keep running).
  • fn file_dialog(flags: u32, path: &mut String, exts: &[&str]) -> (i32, u32) the system Open / Save dialog (see the file header) [plat_file_dialog]

  • fn file_dialog_filter(flags: u32, exts: &[&str]) -> (Vec<u16>, Vec<u16>) the filter list ("description\0pattern\0...\0\0", UTF-16) and the default extension (UTF-16, NUL-terminated; empty text = none) [fd_build_filter]

Source: docs/API.md in the JFLib repository.