咦? 又问! 下午才答了一次, 再PASTE一次吧:<br>procedure GetShellLinkInfo(const LinkFile: WideString; var SLI: TShellLinkInfo);<br>{ Retrieves information on an existing shell link }<br>var<br> SL: IShellLink;<br> PF: IPersistFile;<br> FindData: TWin32FindData;<br> AStr: array[0..MAX_PATH] of char;<br>begin<br> OleCheck(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER,<br> IShellLink, SL));<br> { The IShellLink implementer must also support the IPersistFile }<br> { interface. Get an interface pointer to it. }<br> PF := SL as IPersistFile;<br> { Load file into IPersistFile object }<br> OleCheck(PF.Load(PWideChar(LinkFile), STGM_READ));<br> { Resolve the link by calling the Resolve interface function. }<br> OleCheck(SL.Resolve(0, SLR_ANY_MATCH or SLR_NO_UI));<br> { Get all the info! }<br> with SLI do<br> begin<br> OleCheck(SL.GetPath(AStr, MAX_PATH, FindData, SLGP_SHORTPATH));<br> PathName := AStr;//文件名<br> OleCheck(SL.GetArguments(AStr, MAX_PATH));<br> Arguments := AStr;//参数<br> OleCheck(SL.GetDescription(AStr, MAX_PATH));<br> Description := AStr;//描述<br> OleCheck(SL.GetWorkingDirectory(AStr, MAX_PATH));<br> WorkingDirectory := AStr;//工作路径<br> OleCheck(SL.GetIconLocation(AStr, MAX_PATH, IconIndex));<br> IconLocation := AStr;//图标<br> OleCheck(SL.GetShowCmd(ShowCmd));<br> OleCheck(SL.GetHotKey(HotKey));//热键<br> end;<br>end;<br>