| Код | Uses Windows,SysUtils,ShlObj,ComObj,ActiveX; procedure CreateLink(const PathObj, PathLink, WorkDir, Param, IconFile: string;NumIcon:Integer); var IObject: IUnknown; SLink: IShellLink; PFile: IPersistFile; begin IObject := CreateComObject(CLSID_ShellLink); SLink := IObject as IShellLink; PFile := IObject as IPersistFile; with SLink do begin SetArguments(PChar(Param)); SetWorkingDirectory(PChar(WorkDir)); SetPath(PChar(PathObj)); SetIconLocation(PChar(IconFile),NumIcon); end; PFile.Save(PWChar(WideString(PathLink)), FALSE); end;
| |