[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

connecting to a web-site

Posted on 1997-11-20
4
Medium Priority
?
142 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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