windows-window 0.100.0

Windows windowing library
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented1 out of 1 items with examples
  • Size
  • Source code size: 31.99 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 458.45 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • microsoft/windows-rs
    12750 663 24
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kennykerr

windows-window

The windows-window crate provides basic window creation and message-loop support for Canvas, WebView2, and custom rendering.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-window]
version = "0.100"
use windows_window::*;

fn main() -> Result<()> {
    let window = Window::new("Hello")
        .size(800, 600)
        .on_resize(|width, height| {
            println!("resized to {width} x {height}");
        })
        .create()?;

    // `window.hwnd()` can be handed to windows-canvas, WebView2, Direct2D, etc.
    println!("created window {:?}", window.hwnd());

    run();
    Ok(())
}