Sunbeam Studios

Our open-source projects, here for you!

windows-sys (0.61.2)

Published 2026-03-26 11:06:19 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add windows-sys@0.61.2

About this package

Rust for Windows

windows-sys

The windows-sys crate is a zero-overhead fallback for the most demanding situations and primarily where the absolute best compile time is essential. It only includes function declarations (externs), structs, and constants. No convenience helpers, traits, or wrappers are provided.

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

[dependencies.windows-sys]
version = ">=0.59, <=0.61"
features = [
    "Win32_Security",
    "Win32_System_Threading",
    "Win32_UI_WindowsAndMessaging",
]

Using a range instead of the default Caret requirements helps avoid duplicate versions in downstream graphs and improves resolver flexibility.

Make use of any Windows APIs as needed:

use windows_sys::{
    core::*, Win32::Foundation::*, Win32::System::Threading::*, Win32::UI::WindowsAndMessaging::*,
};

unsafe {
    let event = CreateEventW(std::ptr::null(), 1, 0, std::ptr::null());
    SetEvent(event);
    WaitForSingleObject(event, 0);
    CloseHandle(event);

    MessageBoxA(0 as _, s!("Ansi"), s!("Caption"), MB_OK);
    MessageBoxW(0 as _, w!("Wide"), w!("Caption"), MB_OK);
}

Dependencies

ID Version
windows-link ^0.2.1
Details
Cargo
2026-03-26 11:06:19 +00:00
0
MIT OR Apache-2.0
2.4 MiB
Assets (1)
Versions (5) View all
0.60.2 2026-03-26
0.59.0 2026-03-26
0.52.0 2026-03-26
0.48.0 2026-03-26
0.61.2 2026-03-26