Deal with Windows Registry from Nim.
import winregistry
var
faceName: string
fontSize: int32
fontWeight: int32
h: RegHandle
try:
h = open("HKEY_CURRENT_USER\\Console\\Git Bash", samRead)
faceName = h.readString("FaceName")
fontSize = h.readInt32("FontSize")
fontWeight = h.readInt32("FontWeight")
except OSError:
echo "err: ", getCurrentExceptionMsg()
finally:
close(h)
Run in command line:
$ nimble test
You should see a "tests passed" message. If you get Access is denied
error, try running with administrator rights.
delValue
proc (thanks to @Rafflesiaceae)useWinUnicode
switchWinString
type was removed; use WideCString
insteadRegValueKind
and RegKeyRights
are distinct uint32
's now (fixed warning about enums with holes).RegistryError
with OSError
for consistency with built-in registry
package.taintmode
feature.