import java.awt.*; import java.awt.event.*; import java.io.* ; import java.util.*; import com.ms.wfc.app.Registry; import com.ms.wfc.app.RegistryKey; /* Java 1.1+ GUI Application IE Internet Zone High Template Customizer. Disables all URL actions not already disabled in HIGH security template. Updates registry entries for IE4/5 HIGH Security Template. 02/08/2000 M. Gallant */ public class CustomHighTemplate extends Frame implements ActionListener, MouseListener { private static final int HIGH_SECURITY = 0x00012000; private static final int MEDIUM_SECURITY = 0x00011000; private static final int MEDLOW_SECURITY = 0x00010500; private static final int LOW_SECURITY = 0x00010000; private static final String HighTemplatepath = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\TemplatePolicies\\High"; private static String [] secnames = {"1400", "1405", "1601", "1604", "1802", "1C00" } ; private static int [] customHighValues = {3, 3, 3, 3, 3, 0x00000} ; // disable all active functionality private static int [] defaultHighValues = {0, 0, 1, 1, 1, 0x10000} ; // return to default HIGH template values private Button b1, b2, bexit ; Label l1, lslide; String[] headerfields = {" Customize HIGH Template ", "Version 1.0" , " by M. Gallant 02/07/2000" } ; int headers = headerfields.length ; int headerindex = 0; CustomHighTemplate(String name) { super(name) ; if(System.getProperty("os.name").indexOf("NT")>=0) //for NT platform ; // add other tests for other platform scripts Panel p = new Panel() ; p.setLayout(new GridLayout(1,2,10,10)) ; l1= new Label(headerfields[0],Label.CENTER) ; l1.setFont(new Font("TimesRoman", Font.BOLD, 15)) ; l1.addMouseListener(this) ; l1.setForeground(Color.yellow) ; l1.setBackground(Color.blue) ; lslide = new Label(" --- Customize HIGH Security Template --- ",Label.CENTER) ; b1=new Button("Customize HIGH") ; b1.addActionListener(this) ; b2=new Button("Default HIGH") ; b2.addActionListener(this) ; bexit=new Button("--- EXIT ---") ; bexit.setBackground(Color.red); bexit.addActionListener(this) ; p.add(b1); p.add(b2); p.validate(); Panel p2=new Panel() ; p2.add(p) ; add("Center", p2); p=new Panel(); p.setBackground(Color.blue) ; p.add(l1) ; p.addMouseListener(this) ; add("North",p) ; p=new Panel() ; p.setBackground(Color.lightGray) ; p.setLayout(new GridLayout(2,1)) ; p2 = new Panel() ; p2.add(lslide) ; p.add(p2) ; p2 = new Panel() ; p2.add(bexit); p.add(p2); add("South",p) ; validate(); // getSecurity() ; } public Insets getInsets() { return new Insets(24,5,5,5) ; } public void paint(Graphics g) { g.setColor(Color.black) ; g.fillRect(0,0,this.getSize().width, this.getSize().height) ; } public void mousePressed(MouseEvent e) { headerindex = ++headerindex % headers ; if(headerindex==0) l1.setFont(new Font("TimesRoman", Font.BOLD, 16)) ; else l1.setFont(new Font("TimesRoman", Font.PLAIN, 12)) ; l1.setText(headerfields[headerindex]) ; } public void mouseReleased(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void actionPerformed(ActionEvent e) { if ((e.getActionCommand()).equals("Customize HIGH")){ if(setSecurity(customHighValues)) lslide.setText(" ** All Active Content Disabled ** ") ; else lslide.setText(" ** HIGH Template NOT FOUND ** ") ; } else if ((e.getActionCommand()).equals("Default HIGH")){ if(setSecurity(defaultHighValues)) lslide.setText(" Default HIGH Template ") ; else lslide.setText(" ** HIGH Template NOT FOUND ** ") ; } else if ((e.getActionCommand()).equals("--- EXIT ---")) System.exit(0) ; } private boolean setSecurity(int [] securityValues) { RegistryKey zonekey = Registry.LOCAL_MACHINE.getSubKey(HighTemplatepath, false) ; // read write if(zonekey==null) return false; else { for(int i=0; i