proceudre TForm1.Button1Click(Sender:TObject);
var
AnObj:IUnknown;
ShLink:IShellLink;
PFile:IPersistFile;
FileName:String;
WFileName:WideString;
begin
//access the two interface of the object
AnObj:=CreateComObject(CLSID_ShellLink);
ShLink:=AnObj as IShellLink;
PFile:=AnObj as IPersistFile;
//get the name of the application file
FileName:=ParamStr(0);
//set the link properties
ShLink.SetPath(PChar(FileName));
ShLink.SetWorkingDirectory(PChar(ExtractFilePath(FileName)));
//save the file,using a WideString!
WFileName:=ExtractFilePath(FileName)+Edit1.Text+'.lnk';//将快捷方式文件保存在本程序所在目录
PFile.Save(PWChar(WFileName),False);
end;