Home

Awesome

WindowsRegistry

Windows registry wrappers for Vlang

Package vpm.winreg

Documentation

Documentation

Funcionalidades

How to use

Getting a string value.

import Ddiidev.winreg

h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_read)!

value := h.query_value[string]('ProgramFilesDir')!

println(value)

It is possible to get a value without needing to know the type of the value in the registry.

import Ddiidev.winreg

h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_read)!

value := h.get_value('ProgramFilesDir')!

println(value)

if value is string {
    println("value is string")
}

Defining and creating new value. (Remembering that you need to be as ADM on Windows)

	value_test := 'my_test'

	h := winreg.open_key(.hkey_local_machine, r'SOFTWARE\Microsoft\Windows\CurrentVersion', .key_write)!

	h.set_value('test', value_test)!