WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

SystreeView32 Item - and Selecting Radiobutton in a Treeview window

Keywords: 	  internet explorer Security Settings

Question:

I'm trying to set a radiobutton in Internet Explorer, in a SysTreeView32 control. The control is found under View\Internet Options\Security tab.

Then when you select the custom radio buttons, followed by Settings, you will arrive at the Security Settings treeview. I want to select the item called, "Initialize and script ActiveX controls not marked as safe. How do I do that?

Answer:

This oughta do it:
;Debug(@ON)

AddExtender("wwctl34I.dll")
Run("rundll32.exe", "shell32.dll,Control_RunDLL INETCPL.CPL")
openwnd=DllHwnd("Internet Properties")
tabwnd=cWndByClass(openwnd,"SysTabControl32")

    cSetTabItem(tabwnd,2)                                       ;Security tab
    secwnd=cWndBySeq(openwnd,1)

        Zone=cWndByID(secwnd,1013)       ;Select correct zone
        List=cGetCBText(zone)
        Position=ItemLocate("Local intranet zone",List,@tab)
        cSetCBItem(Zone,Position)

        Level=cWndByID(secwnd,1017)      ;Set security level for that zone
        cRadioButton(Level,1)
        Settings=cWndByID(secwnd,1018)
        cPostButton(Settings)            ;Apply custom configuration for security level
            TimeDelay(1)
            Lvl2openwnd=DllHwnd("Security Settings")
            TimeDelay(1)
            Tree=cWndByClass(Lvl2openwnd,"SysTreeView32")
            Selection="ActiveX Controls and plugins%@TAB%Initialize and script ActiveX controls not marked as safe%@TAB%Enable"
            Enable=cSetTVItem(Tree,Selection)
            TimeDelay(2)
            Sendkeysto("Security Settings","{SPACE}")
            OKButton=cWndByName(Lvl2openwnd,"OK")
            cClickButton(OKButton)
        SiteButton=cWndByID(secwnd,1019)      ;Add \\SWEC0030.pgh.wec.com to Local zone
        cPostButton(SiteButton)
            TimeDelay(1)
            LIZwnd=DllHwnd("Local intranet zone")
            TimeDelay(3)
            AdvButton=cWndBySeq(LIZwnd,6)  ;used sequence number instead of name
            ;AdvButton=cWndByName(LIZwnd,"Advanced...")
            TimeDelay(2)
            cPostButton(AdvButton)
                TimeDelay(1)
                LIZwnd=DllHwnd("Local intranet zone")
                LB=cWndbyID(LIZwnd,1026)
                LBItems=StrUpper(cGetLBText(LB))
                If !StrIndex(LBItems,"HTTP://SWEC0030.PGH.WEC.COM",1,@FWDSCAN)
                    TimeDelay(1)
                    Field=cWndByID(LIZwnd,1010)
                    cSetEditText(Field,"HTTP://SWEC0030.PGH.WEC.COM")
                    AddButton=cWndByName(LIZwnd,"Add")
                    cClickButton(AddButton)
                Endif
                OKButton=cWndByName(LIZwnd,"OK")
                cClickButton(OKButton)
            TimeDelay(1)
            LIZwnd=DllHwnd("Local intranet zone")
            OKButton=cWndByID(LIZwnd,1)
            cClickButton(OKButton)
        TimeDelay(1)

openwnd=DllHwnd("Internet Properties")
CloseButton=cWndBySeq(openwnd,2)
cClickButton(CloseButton)


Article ID:   W12499
Filename:   cSetTVItem and Selecting Radiobutton in Treeview.txt
File Created: 2001:03:02:14:35:04
Last Updated: 2001:03:02:14:35:04