Solved

connecting to a web-site

Posted on 1997-11-20
4
137 Views
Last Modified: 2010-04-04
I would like to make the URL in my about box clickable (hot-link) so it will open in a browser. I am running D1 and would like to implement this with a minimum investment in new tools. Any pointers would be much appreciated.

Thanks, Tom.
0
Comment
Question by:tomcorcoran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1351114
Also a lot of good FREEWARE components on the market.

Use these, they are already made. If not try this one. Or just use the pieces of code you need.

unit LinkLabel;

{*******************************************************}
{                                                       }
{       Delphi Visual Component Library                 }
{                                                       }
{       Copyright € 1996-97 Vitaly Zayko                }
{                                                       }
{                   TLinkLabel                          }
{                                                       }
{*******************************************************}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, ShellAPI,
  Forms;

const
     URLCursor = 1;

type
  TLinkLabel = class(TCustomLabel)
  private
    FLinkColor:TColor;
    FLinkTo:String;
    procedure SetLinkColor(Value:TColor);
  protected
    procedure WMClick(var Msg:TMessage); message WM_LBUTTONDOWN;
  public
    constructor Create(AOwner:TComponent);override;
    destructor Destroy;override;
  published
    property Caption;
    property Font;
    property Color;
    property Visible;
    property ShowHint;
    property AutoSize;
    property WordWrap;
    property Align;
    property Alignment;
    property Enabled;
    property Transparent;
    property LinkColor:TColor read FLinkColor write SetLinkColor
      default clBlue;
    property LinkTo: String read FLinkTo write FLinkTo;
  end;

procedure Register;

implementation

constructor TLinkLabel.Create(AOwner:TComponent);
var
   WinSys:Array [0..255] of Char;
begin
     inherited Create(AOwner);
     Font.Style:=[fsUnderline];
     Font.Color:=clBlue;
     FLinkColor:=clBlue;
     GetSystemDirectory(WinSys,sizeof(WinSys));
     Screen.Cursors[URLCursor]:=LoadCursor(LoadLibrary(StrCopy(WinSys,
       PChar('hlp95en.dll'))),MakeIntResource(100));
     Cursor:=URLCursor;
end;

destructor TLinkLabel.Destroy;
begin
     Font.Style:=[];
     inherited Destroy;
end;

procedure TLinkLabel.SetLinkColor(Value:TColor);
begin
     FLinkColor:=Value;
     Font.Color:=Value;
     Refresh;
end;

procedure TLinkLabel.WMClick(var Msg:TMessage);
begin
     ShellExecute(GetDesktopWindow,'open',PChar(FLinkTo),nil,nil,
       SW_SHOWNORMAL);
end;

procedure Register;
begin
  RegisterComponents('Additional', [TLinkLabel]);
end;

end.

Have fun,
c.u. ZifNab;
0
 

Author Comment

by:tomcorcoran
ID: 1351115
Zifnab,

I'll have to look through the code to see how it works. I'll take your word for it. Thanks a lot, Tom.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1351116
Hello?
Problem solved?
If not this component should help you:
http://torry.rimini.com/vcl/internet/murl.zip
Have fun,
c.u. ZifNab;
0
 

Author Comment

by:tomcorcoran
ID: 1351117
I tried this one also. First dcu version error, the the windows dcu error, then resource file format error .dcr. I e-mailed the author to se if he had a D1 version or do you know? Thanks, Tom.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

689 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