The umbrella crate for calling Windows APIs from Rust.
- π¦ crates.io
- π docs.rs
- π Getting started
- π Source
The windows crate projects the entire Windows API surface β Win32, COM, and
WinRT β into idiomatic Rust, generated from the official Windows metadata. It is
large, so APIs are gated behind Cargo features named after their namespace; you
enable only the modules you use. The API reference
shows which feature enables a given type or function.
For new, minimal projects, prefer generating a focused binding with
windows-bindgen or composing the smaller windows-*
crates documented here.
The remainder of this page covers how the crate is built and maintained. It is
for contributors and is not needed to use windows.
The published crate is generated by tool_package (which drives
windows-bindgen in --package mode) from crates/tools/package/src/windows.txt.
Only src/Windows/mod.rs and per-namespace files are generated; src/lib.rs is
hand-maintained and intentionally serves a docs.rs stub that points to the
external API docs site.
Run cargo test -p windows; see also the workspace test crates.