I want to change proxy settings from BHO before internet explorer navigate to a web address. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
I'm using RegOpenKeyEx , RegSetValueEx, RegCloseKey to change ProxyServer and ProxyEnable values in the BHO, BEFORENAVIGATE2 event. But when it open a registry with RegOpenKeyEx, the function return a value different than ERROR_SUCCESS. If I try to change registry with same code but from a simple program, not BHO, then this code will work, so it is not working in BHO.
RegOpenKeyEx return a LONG type value different than ERROR_SUCCESS which is equal to 5 , so it seems like it cannnot open registry. There is nothing to show, as my code is simple using those 3 functions to open registry and change values. If I do the same in a desktop program then it will successfuly open and change registry values. So I think it has some permissions issues with registry.
How to make it to work, or how to change proxy before internet explorer navugate to a web address, with or without registry ?
RegXxx
API use. - Roman R.ERROR_ACCESS_DENIED
. Not surprising, since a BHO runs in the IE process, and IE runs in a restricted (low integrity) process. - Remy Lebeau