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.
- Open
Options - Options and flags used to configure how a registry key is opened.
- Transaction
- A transaction object.
- Value
- A registry value.
- Value
Iterator - An iterator of registry values.
Enums§
- Type
- The possible types that a registry value could have.
Constants§
- CLASSES_
ROOT - The predefined
HKEY_CLASSES_ROOTregistry key. - CURRENT_
CONFIG - The predefined
HKEY_CURRENT_CONFIGregistry key. - CURRENT_
USER - The predefined
HKEY_CURRENT_USERregistry key. - LOCAL_
MACHINE - The predefined
HKEY_LOCAL_MACHINEregistry key. - USERS
- The predefined
HKEY_USERSregistry key.