1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
| procedure GetLinkInfo(const LinkName: String; var LinkObject,Arguments,Description: String); var IObject: IUnknown; ILink: IShellLink; IFile: IPersistFile; sObj,sArg,sDcr: Array [0..Max_Path] of Char; Find: WIN32_FIND_DATA; LinkFile: WideString; h: THandle; begin LinkFile:= LinkName; IObject := CreateComObject(CLSID_ShellLink); ILink := IObject as IShellLink; IFile := IObject as IPersistFile;
h:= FindFirstFile(PChar(LinkName), Find); If h<> INVALID_HANDLE_VALUE then begin Windows.FindClose(h); IFile.Load(PWChar(LinkFile), STGM_READ); ILink.GetPath(@sObj, Max_Path, Find, SLGP_RAWPATH); ILink.GetArguments(@sArg, Max_Path); ILink.GetDescription(@sDcr, Max_Path); end; LinkObject:= sObj; Arguments:= sArg; Description:= sDcr; end; |