AnnGetHyperlinkString example for Delphi

Note:

This topic is for Document/Medical only.

//This example assumes that hGlobalAnn is a handle to a button annotation.
//A hyperlink string is set and retrieved
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
hGlobalAnn: Integer;
//Note that hGlobalAnn should be a valid value before clicking Button2.

procedure TForm1.Button1Click(Sender: TObject);
begin
   RasterAnn:= CoLEADRasterAnnotation.Create ();
   RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
   RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
   LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
   RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
   szString: WideString;
begin
   RasterAnn.AnnSetHyperlinkString (hGlobalAnn, ANN_LINK_WEBPAGE, 'http://www.leadtools.com');
   RasterAnn.AnnGetHyperlinkString (hGlobalAnn);
   szString:= RasterAnn.AnnHyperlinkString;
   ShowMessage (szString);
end;