Jump to content

regwrite and IE help


Recommended Posts

I have created a test to disable or enable theme and images for IE, but it seems that it doesn't work when use _IEcreateembed.

How can i fix so it works?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()

$Form2 = GUICreate("Form2", 803, 533, 230, 240)
$GUIActiveX = GUICtrlCreateObj($oIE, 5, 30, 780, 400)
$Cbox1 = GUICtrlCreateCheckbox("Images", 12, 6, 64, 20, BitOR($BS_PUSHLIKE,$WS_TABSTOP))
$Cbox2 = GUICtrlCreateCheckbox("Styles", 84, 6, 64, 20, BitOR($BS_PUSHLIKE,$WS_TABSTOP))
$Button1 = GUICtrlCreateButton("Stop", 198, 6, 63, 20)
GUISetState()

_IENavigate ($oIE, "http://www.autoitscript.com")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    if $msg = $GUI_EVENT_CLOSE then
            ExitLoop
    elseif $msg = $button1 Then
        _ieaction($oIE,"stop")

    elseif $msg = $Cbox1 Then
        $Pics = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images")
        if BitAnd(GUICtrlRead($Cbox1),$GUI_CHECKED) == 1 and $Pics == "yes" Then
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no")
            _ieaction($oIE,"refresh")
        elseif BitAnd(GUICtrlRead($Cbox1),$GUI_CHECKED) == 0 and $Pics == "no" Then
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes")
            _ieaction($oIE,"refresh")
        EndIf
        elseif $msg = $button1 Then
        _ieaction($oIE,"refresh")

    elseif $msg = $Cbox2 Then
        $theme = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "UseThemes")
        if BitAnd(GUICtrlRead($Cbox2),$GUI_CHECKED) == 1 and $theme == 1 Then
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "UseThemes", "REG_DWORD", 0)
            _ieaction($oIE,"refresh")
        elseif BitAnd(GUICtrlRead($Cbox2),$GUI_CHECKED) == 0 and $theme == 0 Then
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "UseThemes", "REG_DWORD", 1)
            _ieaction($oIE,"refresh")
        EndIf
    EndIf
WEnd

GUIDelete()
Link to comment
Share on other sites

I have fixed the image remover now. The only thing i´m lost on, is the Stylesheet remover.

Added GuiCtrlDelete and created the object again, and navigated to the site.

Works good to refresh that way too.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...