急,在线等!!!要求在ShellTreeView中打开文件的快捷方式,然后可以得到ShellTreeView的PATH,就象WINDOWS的资源管理器一样
  比如我有个网上领居里一个计算机的快捷方式,在ShellTreeView里双击该快捷方式后,可以直接在ShellTreeView里打开该计算机的所有共享名,就象通过网上邻居打开一样.
  注意不是另外地开个窗口打开.
  我要的结果就是要得到该ShellTreeView的PATH
谢谢
只要解决问题,分数不够另加!(不准放200分,郁闷)

解决方案 »

  1.   

    什么意思啊,不明白阿要得到 ShellTreeView1.SelectedFolder 么?
      

  2.   

    转贴:
    function GetLinkFullFileName(const ALinkName: widestring): string;
    var
      SL: IShellLink;
      PF: IPersistFile;
      FindData: TWin32FindData;
      AStr: array[0..255] of char;
    begin
      OleCheck(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER,
        IShellLink, SL));
      { The IShellLink implementer must also support the IPersistFile }
      { interface. Get an interface pointer to it. }
      PF := SL as IPersistFile;
      { Load file into IPersistFile object }
      {$Warnings off}
      OleCheck(PF.Load(PWideChar(ALinkName), STGM_READ));
      {$Warnings on}
      { Resolve the link by calling the Resolve interface function. }
      OleCheck(SL.Resolve(0, SLR_ANY_MATCH or SLR_NO_UI));
      { Get all the info! }
      OleCheck(SL.GetPath(AStr, MAX_PATH, FindData, SLGP_SHORTPATH));
      Result := Astr;end;用到的单元ShlObj,ActiveX
     Uses ComObj;
      

  3.   

    TO: angle097113(<晨明科技开发>) 
    这个函数我也有,具体怎么使用呢?谢谢
      

  4.   

    ShellTreeView.SelectedFolder.PathName 就可以得到 Path 阿
      

  5.   

    我需要ShellTreeView能够自动跳转到ShellTreeView.SelectedFolder.PathName 这个路径,就象资源管理器一样