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:
[]
= "0.100"
use *;
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(())
}