Samsiol

Hi,

I'm trying to set some security settings of the IE programmatically. I know how to set the registry keys. But how can I reload the security settings in a running instance of the IE (without restarting it) I was playing around with several messages (WM_SETTINGCHANGE, WM_User + ... - I found these hints in the web and I played with Spy++), but I couldn't figure it out.
I wasn't sure if this is possible till today... Today I installed the Internet Explorer Developer Toolbar: And the disable script button does exactly what I would like to do in my application. How does this function work Any ideas I would very much appreciate any help!

Thanks in advance,

Samsiol


Re: Internet Explorer Extension Development Set IE 7 Security Settings Programmatically (without restarting the running IE instance)

IECUSTOMIZER

Hi Samsiol,

I think you just have to reload the page. IE will check the security settings in the registry to see if the location of the page being loaded matches any sites.

Disabling scripting programmatically... unknow... probably in mshtml.dll...

Regads.






Re: Internet Explorer Extension Development Set IE 7 Security Settings Programmatically (without restarting the running IE instance)

Samsiol

Thanks for the Reply!

Reloading the page does not always work. It works the first few times, and then ignores the new settings.

Here is a sample scenario (running Win XP SP2 with IE 7, setting the registry settings with regedit and manually reloading the page):
  • Start IE (script enabled)
  • Set registry key ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1400") to 3 and reload page -> script disabled
  • Set registry key ...\1400 back to 0 and reload -> script enabled
  • Set registry key ...\1400 to 3 and reload -> script disabled
  • Set registry key ...\1400 to 0 and reload -> script enabled
  • Set registry key ...\1400 to 3 and reload -> script disabled
  • Set registry key ...\1400 to 0 and reload -> script stays disabled. IE doesn't load the registry settings anymore (checked with regmon).

Maybe IE caches this info somehow.

An I also couldn't figure out a way to disable scripting using mshtml.

Regards,

Samsiol




Re: Internet Explorer Extension Development Set IE 7 Security Settings Programmatically (without restarting the running IE instance)

MoSalti

Hi Samsiol,

Could you please post info or a link on how to set the IE security settings programatically I am creating a web application and i need it to be set as a trusted site. Also I need to set the "Initialize and script ActiveX controls not marked as safe" to enabled.

I could instruct my users to do this on their own, but I fear they will get frustrated as they are not very good with computers.

Thanks!






Re: Internet Explorer Extension Development Set IE 7 Security Settings Programmatically (without restarting the running IE instance)

Rafael Franco

Hello.

I think write registry to set IE7 property is not a good idea. I have a IE toolbar that set IE7 popup-blocker programatically writing IE7 registry key. It works very well on Windows XP, but not on Windows Vista. This sounds like Windows Vista protect or block some access to registry. I don't know if there are another solution for this problem. I'm still finding.

Best regards