if displayerrormsg = true then 'if the user want errors displayed
msgbox errormsg(rtn) 'display the error
end if
end if
rtn = regclosekey(hkey) 'close the key
else 'if there was an error opening the key
if displayerrormsg = true then 'if the user want errors displayed
msgbox errormsg(rtn) 'display the error
end if
end if
end if
end function
function getdwordvalue(subkey as string, entry as string)
call parsekey(subkey, mainkeyhandle)
if mainkeyhandle then
rtn = regopenkeyex(mainkeyhandle, subkey, 0, key_read, hkey) 'open the key
if rtn = error_success then 'if the key could be opened then
rtn = regqueryvalueexa(hkey, entry, 0, reg_dword, lbuffer, 4) 'get the value from the registry
if rtn = error_success then 'if the value could be retreived then
rtn = regclosekey(hkey) 'close the key
getdwordvalue = lbuffer 'return the value
else 'otherwise, if the value couldnt be retreived
getdwordvalue = "error" 'return error to the user
if displayerrormsg = true then 'if the user wants errors displayed
msgbox errormsg(rtn) 'tell the user what was wrong
end if
end if
else 'otherwise, if the key couldnt be opened
getdwordvalue = "error" 'return error to the user
if displayerrormsg = true then 'if the user wants errors displayed
msgbox errormsg(rtn) 'tell the user what was wrong
end if
end if
end if
end function
function setbinaryvalue(subkey as string, entry as string, value as string)
call parsekey(subkey, mainkeyhandle)
if mainkeyhandle then
rtn = regopenkeyex(mainkeyhandle, subkey, 0, key_write, hkey) 'open the key
if rtn = error_success then 'if the key was open successfully then
ldatasize = len(value)
redim bytearray(ldatasize)
for i = 1 to ldatasize
bytearray(i) = asc(mid$(value, i, 1))
next
rtn = regsetvalueexb(hkey, entry, 0, reg_binary, bytearray(1), ldatasize) 'write the value
if not rtn = error_success then 'if the was an error writting the value
if displayerrormsg = true then 'if the user want errors displayed
msgbox errormsg(rtn) 'display the error
end if
end if
rtn = regclosekey(hkey) 'close the key
else 'if there was an error opening the key
if displayerrormsg = true then 'if the user wants errors displayed
msgbox errormsg(rtn) 'display the error
end if
end if
end if
end function
function getbinaryvalue(subkey as string, entry as string)
call parsekey(subkey, mainkeyhandle)
if mainkeyhandle then
rtn = regopenkeyex(mainkeyhandle, subkey, 0, key_read, hkey) 'open the key
if rtn = error_success then 'if the key could be opened
lbuffersize = 1
rtn = regqueryvalueex(hkey, entry, 0, reg_binary, 0, lbuffersize) 'get the value from the registry
sbuffer = space(lbuffersize)