Closed super-tomcat closed 5 years ago
Hello.
Update to latest winregistry (version 0.2.1), there should be method enumValueNames
. You can use it to read all value names.
import winregistry, sequtils
var handle = 0.RegHandle
try:
handle = open(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",
samRead or samQueryValue or samWow64)
echo(toSeq(handle.enumValueNames()))
finally:
close(handle)
Output:
@["Arial (TrueType)", "Arial Black (TrueType)", "Arial Bold (TrueType)", "Arial Bold Italic (TrueType)", "Arial Italic (TrueType)", "Bahnschrift (TrueType)"...
If you also need font files you can pass each name in enumValueNames
to readString
.
Hello. Update to latest winregistry (version 0.2.1), there should be method enumValueNames. You can use it to read all value names. import winregistry, sequtils
var handle = 0.RegHandle try: handle = open( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", samRead or samQueryValue or samWow64) echo(toSeq(handle.enumValueNames())) finally: close(handle) Output: @["Arial (TrueType)", "Arial Black (TrueType)", "Arial Bold (TrueType)", "Arial Bold Italic (TrueType)", "Arial Italic (TrueType)", "Bahnschrift (TrueType)"...
If you also need font files you can pass each name in enumValueNames to readString.
Hello, I updated to the latest version and its fantastic, keep up the good work
I open a handle to windows fonts like this:
h = open("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", samRead or samQueryValue or samWow64)
But then how do I read all the font names say into a sequence or array?