Shortcut example
acShortcut
component
Following code demonstrates how to create a shell link to your program on the desktop.
procedure
TForm1.Button1Click(Sender: TObject);
begin
acShortcut1.
LinkTarget
:= Application.ExeName;
// next two lines will set icon #4 from shell32.dll
acShortcut1.
IconLocation
:=
acSystemInfo1
.
DirSystem
+
'\shell32.dll'
;
acShortcut1.
IconIndex
:=
4
;
// saving to Test.lnk file on desktop
acShortcut1.
SaveToFile
(
acSystemInfo1
.
DirDesktop
+
'\Test.lnk'
);
end
;