Ebenezer Posted April 5, 2006 Posted April 5, 2006 Hi all. Quick question. Is there a way to prevent the window opened via _IECreate from loading pictures. I analyze multiple image-heavy pages for keywords. Excluding the pics would speed the whole script up significantly. It probably wouldn't be a good idea to edit the IE settings directly, since the user might want to use the browser to surf while the script is running. Might employ it as a second best solution, though if there is no other way Thanks, Ebenezer
Moderators big_daddy Posted April 5, 2006 Moderators Posted April 5, 2006 (edited) Hi all. Quick question. Is there a way to prevent the window opened via _IECreate from loading pictures. I analyze multiple image-heavy pages for keywords. Excluding the pics would speed the whole script up significantly. It probably wouldn't be a good idea to edit the IE settings directly, since the user might want to use the browser to surf while the script is running. Might employ it as a second best solution, though if there is no other way Thanks, EbenezerI think this accomplishes what you are wanting, besides being able to surf while the script is running: #include <IE.au3> Opt("WinTitleMatchMode", 2) Opt("WinWaitDelay", 100) Opt("OnExitFunc", "Toggle_Images") Toggle_Images() $oIE = _IECreate () _IENavigate ($oIE, "http:\\www.google.com") While WinExists("Internet Explorer") Sleep(250) WEnd Func Toggle_Images() $oIE = _IECreate (0) WinWait("about:blank") Sleep(250) ControlSend("about:blank", "", "ToolbarWindow324", "!t") ControlSend("about:blank", "", "ToolbarWindow324", "o") WinWait("Internet Options") WinSetState("Internet Options", "", @SW_HIDE) For $i = 1 To 6 ControlCommand("Internet Options", "", "SysTabControl321", "TabRight", "") Next Sleep(250) ControlSend("Internet Options", "", "SysTreeView321", "{PGDN 3}{DOWN}{SPACE}") ControlClick("Internet Options", "", "Button2") WinWaitClose("Internet Options") WinClose("about:blank") EndFunc ;==>Toggle_Images Edited April 5, 2006 by big_daddy
Moderators big_daddy Posted April 5, 2006 Moderators Posted April 5, 2006 Thanks a lot No problem, but I would suggest using this instead. #include <IE.au3> Opt("WinTitleMatchMode", 2) Toggle_Images(1) $oIE = _IECreate () _IENavigate ($oIE, "http:\\www.google.com") While WinExists("Internet Explorer") Sleep(250) WEnd Toggle_Images() Func Toggle_Images($On_Off=0) If $On_Off == 0 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes") Else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no") EndIf EndFunc ;==>Toggle_Images
Ebenezer Posted April 8, 2006 Author Posted April 8, 2006 :"> Sigh, this Forum always makes me feel so inadequate. Now my questions are answered, before I even ask them Thanks again for your help
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now