Solved

Detecting Internet Browsers from Delphi

Posted on 1998-11-22
6
338 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:ggets
6 Comments
 
LVL 7

Expert Comment

by:BlackMan
ID: 1347604
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;

0
 
LVL 1

Expert Comment

by:Asw
ID: 1347605
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;
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1347606
Hmmm, Asw, that won't tell you what your default browser is, it will just start it...
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:ggets
ID: 1347607
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.
0
 
LVL 1

Accepted Solution

by:
sassas081597 earned 200 total points
ID: 1347608
Standart programs Like MS FrontPage detect the browsers looking for their names in Registry. So look in the registry if \HKey_Local_Machine\Software\Microsoft\Internet Explorer\Version exists and then read this version. The same way look for Netscape version. However if a third firm's browser is installed - then you cannot find it, except the way it it the default browser. For the default browser look the first comment to your answer.
0
 

Author Comment

by:ggets
ID: 1347609
Thanks - would like to share these points between Blackman & sassas. Is that possible? ( no points for answering that though)
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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

807 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