Function SHGetKnownFolderPath

Source
pub fn SHGetKnownFolderPath(
    folder_id: &KNOWNFOLDERID,
    flags: KF,
    token: Option<&HACCESSTOKEN>,
) -> HrResult<String>
Available on crate features advapi and shell only.
Expand description

SHGetKnownFolderPath function.

ยงExamples

Retrieving documents folder:

use winsafe::{self as w, prelude::*, co};

let docs_folder = w::SHGetKnownFolderPath(
    &co::KNOWNFOLDERID::Documents,
    co::KF::DEFAULT,
    None,
)?;

println!("Docs folder: {}", docs_folder);