unit creat_cj;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs
  ,ActiveX,ComObj,Shlobj,Registry, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
const
  IID_IPersistFile:TGUID='{0000010B-0000-0000-C000-000000000046}';
implementation{$R *.DFM}
function GetShellFolder(const Folder:String):String;
  const
    cWin32='SOFTWARE\Microsoft\Windows\CurrentVersion';
    cSHellPrefix='\Explorer\Shell Folders';
  var
  r:TRegistry;
  begin
    result:='';
    r:=TRegistry.Create;
  try
    r.RootKey:=HKEY_CURRENT_USER;
   if r.OpenKey(cWin32+cShellPrefix,False) then
    Result:=r.readstring(Folder)+'\';
    finally
      r.Free;
    end;
end;
function CreateLink(aPathObj,aPathLink,aDesc:string):Boolean;
  var
    sLink:IShellLink;
    PersFile:IPersistFile;
  begin
    sLink.SetPath(pchar(apathobj));
    sLink.SetDescription(PChar(aDesc));
    if SUCCEEDED(slink.queryInterface(IID_IPersistFile,PersFile)) then
      begin
       PersFile.Save(StringToOLEStr(aPathlink),True);
       result:=false;
       end;
      result:=True;
  end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  Createlink('e:\qyfw1\qyfw.exe',GetShellFolder('Desktop')+'mylink.lnk','dfdfd');
   
end;end.