Solved

Detecting Internet Browsers from Delphi

Posted on 1998-11-22
6
332 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now