Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting and setting IE home page

Posted on 2004-08-24
1
157 Views
Last Modified: 2010-04-04
Hi,

How can I programmatically get and set the home page URL of Internet Explorer?  I need something such as...

function GetIEHomePage: string;
procedure SetIEHomePage(URL: string);

The code needs to reliably work with IE 5 and greater and handle any errors appropriately.  Setting the home page would only be done if the user requests it.

Thanks in Advance,

Richard
0
Comment
Question by:Richard2000
1 Comment
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 50 total points
ID: 11887174
There you go, the functions are just like you wanted them:

uses
  Registry, SysUtils;

//*** To get/set Internet Explorer Home Page read/write this key
//HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
function GetIExplorerHomePage:string;
var
  Reg:TRegistry;
begin
  Reg:=TRegistry.Create;
  try
    if (Reg.OpenKeyReadOnly('\Software\Microsoft\Internet Explorer\Main')) then
      Result:=Reg.ReadString('Start Page')
    else
      Result:=''
  finally
    Reg.Free
  end
end;

procedure SetIExplorerHomePage(NewHomePage:string);
var
  Reg:TRegistry;
begin
  Reg:=TRegistry.Create;
  try
    if (Reg.OpenKey('\Software\Microsoft\Internet Explorer\Main', False)) then
      Reg.WriteString('Start Page', NewHomePage)
    else
      raise Exception.Create('Could not access registry key')
  finally
    Reg.Free
  end
end;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question