Solved

connecting to a web-site

Posted on 1997-11-20
4
133 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 106
Delphi XE2 application frozen on Windows 10 10 277
Base1 Encode/Decode 3 68
Graphics32 under Delphi 10.1 Berlin 2 38
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now