Solved

Getting and setting IE home page

Posted on 2004-08-24
1
159 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 151
Create a path if not exists 7 124
How to convert memory stream to PDF file 6 219
Tidtcpserver listening on multiports? 1 54
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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