Opening the registry
Posted: Sat May 03, 2008 11:40 am
I'm trying to write some code to read some values from the registry. Here's what I have so far - however, the code always fails to open the registry. Any ideas why?
Many thanks,
Tony
Code: Select all
hKey.l
OpenConsole()
Str.s = "Software\Microsoft\WindowsNT\CurrentVersion"
RetCode.l = RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, @Str, 0, #KEY_READ, @hKey)
If RetCode = #ERROR_SUCCESS
PrintN("Opened OK")
Else
PrintN("Failed")
EndIf
RegCloseKey_(hTestKey)
Input()
CloseConsole()
Tony