Board index » delphi » How do I link to a web page from inside a program

How do I link to a web page from inside a program

I remember seeing some code that made it so that when you clicked on a
tLabel, it went to a web site, but now that I want to use it I can't
find it, could someone please tell me how to do this.

TTFN
Arclight

Web Site:
wkweb5.cableinet.co.uk/daniel.davies/

 

Re:How do I link to a web page from inside a program


In article <38df84d8.6665...@news.cableinet.co.uk>,

Quote
daniel.dav...@cableinet.co.uk (Arclight) writes:
>I remember seeing some code that made it so that when you clicked on a
>tLabel, it went to a web site, but now that I want to use it I can't
>find it, could someone please tell me how to do this.

I use something like this:

procedure TForm1.WebConnect(addr: string);
begin
  Screen.Cursor:= crDefault;
if MessageDlg('You must either be already on line or be set up to automatically
'
      + #13 + 'connect to your service provider to complete this operation.'
      +#13  + '                Do you wish to Continue? '
      +#13  + 'You can connect now if you wish and then click
yes',mtConfirmation,[mbYes,mbNo],0)
          = mrYes then
 try
   ShellExecute(Handle,nil,pchar(addr),nil,nil,SW_SHOW);
except
 on e: exception do
  //whatever you want
  end;
end;

Gordon.
~~~~~~~~~~~~~~~~~~~~~~~~
Try one get one free Equation Illustrator V equation editor
http://www.mgcsoft.com/betas.htm  :))
http://members.aol.com/delphistuf/delphstf.htm   (Delphi bits and bobs and a
few links)

MGCSoft

Re:How do I link to a web page from inside a program


Quote
Arclight wrote:
> I remember seeing some code that made it so that when you clicked on a
> tLabel, it went to a web site, but now that I want to use it I can't
> find it, could someone please tell me how to do this.

OnClick event:
ShellExecute(0, 'open', PChar(webaddress)......

Regards,
Udo
--
Please reply to newsgroup. No PMs unless requested.

Re:How do I link to a web page from inside a program


On Mon, 27 Mar 2000 20:01:28 +0200, Udo Nesshoever

Quote
<newsgroup.re...@gmx.net> wrote:
>Arclight wrote:

>> I remember seeing some code that made it so that when you clicked on a
>> tLabel, it went to a web site, but now that I want to use it I can't
>> find it, could someone please tell me how to do this.

>OnClick event:
>ShellExecute(0, 'open', PChar(webaddress)......

When I try to use ShellExecute, I get an error saying : undeclared
identifier: 'ShellExecute'
so how do I get shellexecute to work?

TTFN
Arclight

Web Site:
wkweb5.cableinet.co.uk/daniel.davies/

Re:How do I link to a web page from inside a program


Hi,

you can download TGotoWeb at Torry's Delphi Pages
(http://torry.spang.org). It's in the VCL section under 'Internet #1'.
This component can be used to create a link. I use it in my programs to
add a link to the about box. Download one of my programs (URL of site at
bottom of message) if you want a some sample code.

Arclight schreef:

Quote
> I remember seeing some code that made it so that when you clicked on a
> tLabel, it went to a web site, but now that I want to use it I can't
> find it, could someone please tell me how to do this.

> TTFN
> Arclight

> Web Site:
> wkweb5.cableinet.co.uk/daniel.davies/

--
Koen Van Baelen
koen.van.bae...@pandora.be
http://users.pandora.be/koen.van.baelen
--

Re:How do I link to a web page from inside a program


In article <38dfac5c.16782...@news.cableinet.co.uk>,

Quote
daniel.dav...@cableinet.co.uk (Arclight) writes:
>I get an error saying : undeclared
>identifier: 'ShellExecute'
>so how do I get shellexecute to work?

uses ShellApi;

Gordon.
~~~~~~~~~~~~~~~~~~~~~~~~
Try one get one free Equation Illustrator V equation editor
http://www.mgcsoft.com/betas.htm  :))
http://members.aol.com/delphistuf/delphstf.htm   (Delphi bits and bobs and a
few links)

MGCSoft

Re:How do I link to a web page from inside a program


On Mon, 27 Mar 2000 19:33:53 GMT, Koen Van Baelen

Quote
<koen.van.bae...@pandora.be> wrote:
>Hi,

>you can download TGotoWeb at Torry's Delphi Pages
>(http://torry.spang.org). It's in the VCL section under 'Internet #1'.
>This component can be used to create a link. I use it in my programs to
>add a link to the about box. Download one of my programs (URL of site at
>bottom of message) if you want a some sample code.

Thankyou.

TTFN
Arclight

Web Site:
wkweb5.cableinet.co.uk/daniel.davies/

Re:How do I link to a web page from inside a program


On 27 Mar 2000 19:38:47 GMT, gwhit41...@aol.com (Gordon Whittam)
wrote:

Quote
>In article <38dfac5c.16782...@news.cableinet.co.uk>,
>daniel.dav...@cableinet.co.uk (Arclight) writes:

>>I get an error saying : undeclared
>>identifier: 'ShellExecute'
>>so how do I get shellexecute to work?

>uses ShellApi;

thanks.

TTFN
Arclight

Web Site:
wkweb5.cableinet.co.uk/daniel.davies/

Other Threads