Link to home
Start Free TrialLog in
Avatar of ggets
ggets

asked on

Detecting Internet Browsers from Delphi

I need to detect weather or not a system (running 95,98 or NT) has internet browsers installed, and if so which one the default one is.

I know it can be done in a web page, but I need to do it from a delphi App.
Avatar of BlackMan
BlackMan

First, check to see if the HTM extension is associated with a program. If it is, you can load the path of the program, that will handle HTM files and check for the browser name.
Example is here:

  Uses Registry;
  With TRegistry.Create Do
  Begin
    RootKey := HKEY_Classes_Root;
    OpenKeyReadOnly('.htm');
    ExtName := ReadString('');
    CloseKey;

    ExtName := ExtName + '\shell\open\command';
    OpenKeyReadOnly(ExtName);
    AppPath := ReadString('');
    CloseKey;

    ShowMessage(AppPath);
  End;

Hi,

Try this code.

Use the ShellAPI function ShellExecute.

Example:

uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShellExecute(Form1.Handle,
               nil,
               'http://www.borland.com',
               nil,
               nil,
               SW_SHOWNORMAL);
end;
Hmmm, Asw, that won't tell you what your default browser is, it will just start it...
Avatar of ggets

ASKER

Your solution will only run the browser. Not tell me if its installed not or not.(other that the fact that the command will fail). It is not acceptable to me to run the browser. I must just know if it is installed. I also need to know in more than one is installed and which the default one is. So far the closest answer is the one from blackman, however it will not return a list of installed browsers.
ASKER CERTIFIED SOLUTION
Avatar of sassas081597
sassas081597

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ggets

ASKER

Thanks - would like to share these points between Blackman & sassas. Is that possible? ( no points for answering that though)