Expand description
§Code generator for Windows metadata
The windows-bindgen crate automatically generates Rust bindings from Windows metadata.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-targets]
version = "0.53"
[dev-dependencies.windows-bindgen]
version = "0.59"
Generate Rust bindings in a build script as follows:
fn main() {
let args = [
"--out",
"src/bindings.rs",
"--flat",
"--filter",
"GetTickCount",
];
windows_bindgen::bindgen(args);
}
And then use the bindings as follows:
ⓘ
mod bindings;
fn main() {
unsafe {
println!("{}", bindings::GetTickCount());
}
}
Functions§
- The Windows code generator.