Solved

Launch default browser?

Posted on 1998-11-04
6
811 Views
Last Modified: 2010-05-18
How do I launch the default browser within a delphi application, using a url adress? I am currently using Delphi 3 C/S.
0
Comment
Question by:svenj
  • 3
  • 2
6 Comments
 

Author Comment

by:svenj
ID: 1345545
Adjusted points to 50
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345546
svenj

the best way to do it is use the SHellAPI call Shellexecute...

Add ShellAPI to your uses clause...

uses
Windows, Forms, ..., ShellAPI;

ShellExecute(handle, 'open', 'http://www.delphi32.com', '' , '', SW_SHOWNORMAL);

LAter
BoRiS
0
 

Author Comment

by:svenj
ID: 1345547
That didn't work for me. Nothing happens. If I replace 'http:\\www.delphi32.com' with 'c:\index.html' then the program launches the browser with the page index.html. Why is that?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 4

Expert Comment

by:BoRiS
ID: 1345548
svenj

did you have a browser window open when you used shellexecute, because what happens
is that it will load it in the open browser window...this works as I have used it several times myself...

to test close all your browsers windows just leave delphi open and then run the shellexecute command

Later
BoRiS
0
 

Author Comment

by:svenj
ID: 1345549
BoRiS

It won´t work for me. As far as I know I've done everything right. Any way, I changed my mind and will use the 'c:\index.html' instead.
Many thanks

svenj

0
 
LVL 3

Accepted Solution

by:
bryan7 earned 50 total points
ID: 1345550
try this component

"TGoToWeb
                    v2.1"

at   http://www.torry.ru/

in the section "Lan & Communications", ---> "Internet#2"

there's a component that lets you start the default browser, and jump to
the desired URL.

bryan

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…

856 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