Sign in to follow this  
Followers 0
Robin

Restart IE7 instead of Refreshing

17 posts in this topic

I need some info om how to make IE7 know i did a registry setting change WITHOUT restarting...I read it has something to do with "wininet.dll " and "user32.dll"...Thing is, after doing some registry-injections (Trusted Sites), the changes only get noticed AFTER a restart of Internet Explorer7. If i do a normal F5(Refresh), the page re-loads but nothing changes...Your help would be highly appreciated guys...I've been sitting with this prob for a couple of days now and read through quite a bit of scripts, but everyone is talking about "proxies"

Tia

Share this post


Link to post
Share on other sites



I need some info om how to make IE7 know i did a registry setting change WITHOUT restarting...I read it has something to do with "wininet.dll " and "user32.dll"...Thing is, after doing some registry-injections (Trusted Sites), the changes only get noticed AFTER a restart of Internet Explorer7. If i do a normal F5(Refresh), the page re-loads but nothing changes...Your help would be highly appreciated guys...I've been sitting with this prob for a couple of days now and read through quite a bit of scripts, but everyone is talking about "proxies"

Tia

The changes have to bo in place when IE starts in order for them to be recognized.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I need some info om how to make IE7 know i did a registry setting change WITHOUT restarting...I read it has something to do with "wininet.dll " and "user32.dll"...Thing is, after doing some registry-injections (Trusted Sites), the changes only get noticed AFTER a restart of Internet Explorer7. If i do a normal F5(Refresh), the page re-loads but nothing changes...Your help would be highly appreciated guys...I've been sitting with this prob for a couple of days now and read through quite a bit of scripts, but everyone is talking about "proxies"

Tia

What change did you make? Some things can be changed without a restart, and some can't.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

... after doing some registry-injections (Trusted Sites), the changes only get noticed AFTER a restart of Internet Explorer7. ...

That change does not require a restart when done via the app's GUI. I'm not sure if the GUI does anything special upon exit or not. Please show some sample code for us to work with.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

100% correct...I basicly wrote a program that changes the "trusted Site" domain entries. Instead of going the long way to add a trusted site, you just click on my program, enter the domain and its added. I did do some reading and found out that apparently IE does a sort of "re-read" of the registry to aknowlege the change that usely is automaticly done if you enter the site via "inetcpl.cpl"...or as some guys would sy via the "Tools" menu...In MY case a normal refresh doesnt work...The browser HAVE TO be re-started before the change gets reccognized. All i need to know is WHAT triggers the "registry-re-read" :)

Share this post


Link to post
Share on other sites

Search the forum for InternetSetOption

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Search the forum for InternetSetOption

Dale

Thanks for the reply DaleHohm...i have tried the ==DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)== but with no luck...but i'll keep searching here :)

PS:

I had a look on the net and it seems this script-code works with proxy setting/changes only.

Edited by Robin

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks for the reply DaleHohm...i have tried the ==DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)== but with no luck...but i'll keep searching here :)

PS:

I had a look on the net and it seems this script-code works with proxy setting/changes only.

I'll agree that it seems the most common use for this is for Proxy setting, but I don't see where it states on MSDN that this (INTERNET_OPTION_SETTINGS_CHANGED) is specifically for Proxies. I do see where INTERNET_OPTION_REFRESH says it causes proxy settings to be re-read from the registry, I'm curious if it would help any in this case.

Something like:

Func _Internet_Update_RegistryChange($h_wnd = 0)
    Local Const $_INTERNET_OPTION_SETTINGS_CHANGED = 39
    Local Const $_INTERNET_OPTION_REFRESH = 37
    DllCall("wininet.dll", "int", "InternetSetOption", "hwnd", $h_wnd, "dword", $_INTERNET_OPTION_SETTINGS_CHANGED, "str", "", "dword", 0)
    DllCall("wininet.dll", "int", "InternetSetOption", "hwnd", $h_wnd, "dword", $_INTERNET_OPTION_REFRESH, "str", "", "dword", 0)
    Return
EndFunc

If that doesn't work, I'd have to say to try this one ... And if that doesn't work... I dunno.

Func _Internet_Update_RegistryChange($h_wnd = 0, $i_utimeout = 1000)
    Local Const $_INTERNET_OPTION_SETTINGS_CHANGED = 39
    Local Const $_HWND_BROADCAST = 0x00FFFF
    Local Const $_WM_SETTINGCHANGE = 0x001A
    Local Const $_SMTO_NORMAL = 0
    Local $h_settingchange = $_HWND_BROADCAST
    If $h_wnd Then $h_settingchange = $h_wnd
    
    DllCall("wininet.dll", "int", "InternetSetOption", _
            "hwnd", $h_wnd, _
            "dword", $_INTERNET_OPTION_SETTINGS_CHANGED, _
            "str", "", _
            "dword", 0)
            
    DllCall("user32.dll", "int", "SendMessageTimeout", _
            "hwnd", $h_settingchange, _
            "uint", $_WM_SETTINGCHANGE, _
            "lparam", 0, _
            "wparam", 0, _
            "uint", $_SMTO_NORMAL, _
            "uint", $i_utimeout, _
            "ptr", 0)
    Return
EndFunc

Edit:

It's better if you pass the handle to the IE window you're dealing with if you want speed, $HWND_BROADCAST will tell all top level windows there was a change, so they all may check their settings... and with a 1 second timeout as default, with 20 top level windows... it could take as much as 20 seconds to tell them all.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thanks SmOke_N...I'll give your code a try. I manage to get to some site with all the parammeters 36, 39 etc etc and nowhere could i find the correct setting...What i'm goint to try now as well is to run a ReMon and see what the hell actually "triggers"" the IE Refresh/Update...lol

Apparently this has somethimng to do with it---> rundll32.exe shell32.dll,Control_RunDLL Inetcpl.cpl<---

...i just need the correct setting for "Inetcpl.cpl"...

Edited by Robin

Share this post


Link to post
Share on other sites

Thanks SmOke_N...I'll give your code a try. I manage to get to some site with all the parammeters 36, 39 etc etc and nowhere could i find the correct setting...

Always best to start with the horses mouth? lol...

http://msdn.microsoft.com/en-us/library/aa385114.aspx

http://msdn.microsoft.com/en-us/library/aa385328(VS.85).aspx


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Ok mates, i came across a site where someone had an idea...Seeing i'm still very stupid with Autoit "Advanced-Functions", what do you guys make out of the following and also, what commans do you suggest i have a look at? This is what the guy posted and it makes sorta sence --->

==========================================

Here is a way that has worked for me on IE7...

You can use WinDbg to see what INETCPL.CPL does after you change some settings. It ends up posting an apparently undocumented 0x0552 message back to a hidden top level window maintained by IE. You can see that window with Spy++. It's window class name is "Internet Explorer_Hidden". So to get IE to do a comprehensive refresh, including the effects of registry settings changes (at least the ones I tried), without needing to restart IE, you can emulate what INETCPL.CPL does and just call PostMessage sending a 0x552 message to the hidden IE window.

A wrinkle is that one IE process can have more than one instance of this same class of hidden top-level window. Also, you might have multiple separate IE processes running or other processes (like dexplore.exe the Visual Studio document explorer) that use the IE DLLs to show HTML content. To tell them all to do the comprehensive refresh I just put in a loop using FindWindowEx looking for all the top level windows with that window class name. I post the same 0x552 message to all of them and they all refresh OK.

==================================

Looks like this guy HAS something...

Well guys, seems i'm stuffed :)

Edited by Robin

Share this post


Link to post
Share on other sites

After days of searching with no results at this forum, i doubt it can be done...but then i came apon this bit...Not sure with what programming it is done, but i want to ask you pro's a big question...How can i convert the following "code" to AutoIt code?

---> whwnd = FindWindow("progMan", "program manager")SendMessage whwnd, WM_SETTINGCHANGE, 0, 0 <---

I need this to do a "Registry Refresh" not on program manager, but on IE7 :)

PS:

thx to all the other guys trying to help me previuosly, but the advise only worked for proxy settings...now i hope the above will work for ZONE settings in the registry that i have changed to have immediate effect...

Share this post


Link to post
Share on other sites

#include <WinAPI.au3>
#include <WindowsConstants.au3>

Global Const $WM_SETTINGCHANGE = $WM_WININICHANGE

$hwnd = _WinAPI_FindWindow ("progMan", "program manager")
_SendMessage( $hwnd, $WM_SETTINGCHANGE, 0, 0)
Thanks Zedna...but unfortunately it didn't work :)

It was suppose to "update/recognize" the registry settings immediately, but i still need to restart IE7 before my changes takes effect(after doing changes to my Trusted Zones).

Share this post


Link to post
Share on other sites

Thanks Zedna...but unfortunately it didn't work :)

It was suppose to "update/recognize" the registry settings immediately, but i still need to restart IE7 before my changes takes effect(after doing changes to my Trusted Zones).

Come 2 think of it...I think your code IS correct...I just need to find whatever is going into the ("progMan", "program manager") bit...

Share this post


Link to post
Share on other sites

After days of searching with no results at this forum, i doubt it can be done...but then i came apon this bit...Not sure with what programming it is done, but i want to ask you pro's a big question...How can i convert the following "code" to AutoIt code?

---> whwnd = FindWindow("progMan", "program manager")SendMessage whwnd, WM_SETTINGCHANGE, 0, 0 <---

I need this to do a "Registry Refresh" not on program manager, but on IE7 :)

PS:

thx to all the other guys trying to help me previuosly, but the advise only worked for proxy settings...now i hope the above will work for ZONE settings in the registry that i have changed to have immediate effect...

This is nothing different than what I showed you in post #8, if you used the last example.

_Internet_Update_RegistryChange() without parameters, it would send the message to all top level windows.

If that doesn't work, then sending it directly to the desktop window I doubt would work as well.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

This is nothing different than what I showed you in post #8, if you used the last example.

_Internet_Update_RegistryChange() without parameters, it would send the message to all top level windows.

If that doesn't work, then sending it directly to the desktop window I doubt would work as well.

Yeah...I remember you mentioned it...Thanks anyways to both of you guys for trying to help...much appreciated :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0