Re: RegOpenKey not working
RegOpenKeyEx HKEY_CURRENT_USER, "YourSubkey", 0, KEY_ALL_ACCESS, Result
The Result and Hkey are reversed in your code.
It returns the Hkey and delivers a Result in an argument.
Re: RegOpenKey not working
thanks,
Does anybody know how to fix it, it sets permissions on the reg keys
Re: RegOpenKey not working
Did you reverse Result and Hkey in your code?
Re: RegOpenKey not working
@ chris1990. Your code is correct for what you are trying to achieve. The error code 2 is telling you (most likely) that the subkey doesn't exist. Do a Debug.Print on "KeyName" and check that it already exists in the registry to make sure it's valid.