Crates.io | windows-bindgen |
lib.rs | windows-bindgen |
version | 0.64.0 |
created_at | 2021-10-18 14:45:50.46351+00 |
updated_at | 2025-09-25 18:08:07.577776+00 |
description | Code generator for Windows metadata |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 466812 |
size | 32,766,773 |
The windows-bindgen crate automatically generates Rust bindings from Windows metadata.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-link]
version = "0.2"
[build-dependencies.windows-bindgen]
version = "0.63"
Generate Rust bindings in a build script as follows:
let args = [
"--out",
"src/bindings.rs",
"--flat",
"--sys",
"--filter",
"GetTickCount",
];
windows_bindgen::bindgen(args).unwrap();
And then use the bindings as follows:
mod bindings;
unsafe {
println!("{}", bindings::GetTickCount());
}