You missed a bit, grey: The code above still needs the following as well:
Import "-ladvapi32" Extern "win32" Function RegOpenKey:Int(hKeyParent:Int,SubKey$z,phkResult:Byte Ptr)="RegOpenKeyA@12" Function RegCloseKey:Int(hKey:Int)="RegCloseKey@4" Function RegQueryValueEx:Int(hKey:Int,ValueName$z,Reserved:Int,nType:Byte Ptr,ValueBytes:Byte Ptr,ValueSize:Byte Ptr)="RegQueryValueExA@24" EndExtern Const HKEY_LOCAL_MACHINE = -2147483646