从这个IShellLink名字的COM可以得到。

解决方案 »

  1.   

    unit Unit1;
    interface
    uses
      Windows, Messages, SysUtils, Classes,ShlObj, ComObj ,ActiveX, Controls,
      StdCtrls , Graphics, Forms, Dialogs;
    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
      aObj: IUnknown;
      MyPFile: IPersistFile;
      MyLink: IShellLink;
      WFileName: WideString;
      FileName:array[0..255] of char;
      pfd:WIN32_FIND_DATA;
    begin
      aObj := CreateComObject(CLSID_ShellLink);
      MyPFile := aObj as IPersistFile;
      MyLink := aObj as IShellLink;
      WFileName := 'C:\Delphi.lnk';
      MyPFile.Load(PWChar(wfilename), 0);
      MyLink.GetPath(FileName,255,pfd,SLGP_UNCPRIORITY);
      showmessage(String(FileName));end;end.
      

  2.   

    非常感谢black_fox(black_fox) ,我试试看!