Crates.io | winwrap |
lib.rs | winwrap |
version | 0.1.1 |
source | src |
created_at | 2020-10-10 21:43:53.117558 |
updated_at | 2020-10-17 18:29:15.460091 |
description | Rust-friendly Windows API wrappers |
homepage | https://github.com/takubokudori/winwrap |
repository | https://github.com/takubokudori/winwrap |
max_upload_size | |
id | 298182 |
size | 307,125 |
Rust-friendly Windows API Wrappers.
[dependencies]
winwrap = "0.1.0"
or
[dependencies.winwrap]
version = "0.1.0"
features = ["ansi"] # TCHAR == CHAR, TString == AString
use winwrap::um::fileapi::*;
use winwrap::winapi::shared::winerror::ERROR_NO_MORE_FILES;
fn enumerate_files_w() {
use winwrap::string::WString;
let path = WString::from(r".\*.*");
let (handle, mut data) = find_first_file_w(&path).unwrap();
loop {
println!("name: {:?}", data.get_file_name().to_string_lossy());
println!("\tflags: {:?}", data.file_attributes);
println!("\talternate file name: {}", data.get_alternate_file_name().to_string_lossy());
println!("----------------------------");
data = match find_next_file_w(&handle) {
Ok(x) => x,
Err(ERROR_NO_MORE_FILES) => {
println!("All files enumerated!");
break;
}
Err(x) => panic!("Unknown Error: {}", x),
};
}
}
fn main(){
enumerate_files_w();
}
This software is released under the MIT License, see LICENSE.