Skip to main content

Crate windows_registry

Crate windows_registry 

Source
Expand description

§windows-registry

The windows-registry crate reads and writes the Windows registry.

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

[dependencies.windows-registry]
version = "0.100"
use windows_registry::*;

fn main() -> Result<()> {
    let key = CURRENT_USER.create(r"software\windows-rs")?;

    key.set_u32("number", 123)?;
    key.set_string("name", "Rust")?;

    println!("{}", key.get_u32("number")?);
    println!("{}", key.get_string("name")?);

    Ok(())
}

Structs§

HSTRING
An (HSTRING) is a reference-counted and immutable UTF-16 string type.
Key
A registry key.
KeyIterator
An iterator of registry key names.
OpenOptions
Options and flags used to configure how a registry key is opened.
Transaction
A transaction object.
Value
A registry value.
ValueIterator
An iterator of registry values.

Enums§

Type
The possible types that a registry value could have.

Constants§

CLASSES_ROOT
The predefined HKEY_CLASSES_ROOT registry key.
CURRENT_CONFIG
The predefined HKEY_CURRENT_CONFIG registry key.
CURRENT_USER
The predefined HKEY_CURRENT_USER registry key.
LOCAL_MACHINE
The predefined HKEY_LOCAL_MACHINE registry key.
USERS
The predefined HKEY_USERS registry key.

Type Aliases§

Result
A specialized Result type that provides Windows error information.