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.
I know it can be done in a web page, but I need to do it from a delphi App.
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;
Try this code.
Use the ShellAPI function ShellExecute.
Example:
uses ShellAPI;
procedure TForm1.Button1Click(Sender
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...
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks - would like to share these points between Blackman & sassas. Is that possible? ( no points for answering that though)
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;