I am getting an exception when I try to set this registry setting:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Display Inline Images
It says:
Cannot write to the registry key.
That is all it says...
Anyone have a reason why?
Printable View
I am getting an exception when I try to set this registry setting:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Display Inline Images
It says:
Cannot write to the registry key.
That is all it says...
Anyone have a reason why?
if I'm not mistaken you have to edit the reg before writing .
Do you think any security reasons behind that.I bet so
can you edit anything else in CurrentUser, beside the explorer's setting?
Yes, I can edit and create other keys in the current user section. I use the HKEY_CURRENT_USER\Software\MySoftware section for my other app settings with no problems. It is like MS set up a security thing or something on their settings.
I hope this isn't a duplicate of what you already have, but I just tested this on mine and it worked.
VB Code:
Dim reg As Microsoft.Win32.Registry Dim rk As Microsoft.Win32.RegistryKey rk = reg.CurrentUser.OpenSubKey("Software\Microsoft\Internet Explorer\Main", True) rk.SetValue("Display Inline Images", MyValue)
I didn't include true as an argument for the opensubkey function. That is probably what I am doing wrong....lol. Thanks, I will try it.
aaaaaaaaaah you said it says "cannot write...":D so I thought this isnt the problem. Before, I had a same problem where VB told me "permission denied". I didnt think this is the same situation :p
so the problem was with security or returning value??
Code given by MagellanTX is correct. Make sure that the user under which you run your application has a right to change the registry.
Dude , this thread is almost 7 years ago !!! :confused:Quote:
Originally Posted by exaspring