delphi获取ie收藏夹路径

//取特殊文件夹目录
//----------------------------------------------------------------

function   GetSpecialFolderDir(const   folderid:   integer):   string;
var
    pidl                             :   pItemIDList;
    buffer                         :   array[0..255]   of   char;
begin
    SHGetSpecialFolderLocation(Application.Handle,   folderid,   pidl);
    SHGetPathFromIDList(pidl,   buffer);         //转换成文件系统的路径
    result   :=   strpas(buffer);
end;


//取收藏夹目录
//----------------------------------------------------------------

function   GetFavPath:   string;
begin
    result   :=   GetSpecialFolderDir(CSIDL_FAVORITES);
end;
转自:http://topic.csdn.net/t/20020307/07/559790.html

以下是原创:

procedure TForm1.btn1Click(Sender: TObject);
  var
    buffer:array[0..255] of char;
begin
 // ShowMessage(GetSpecialFolderDir(CSIDL_FAVORITES));
  SHGetSpecialFolderPath(Application.Handle,buffer,CSIDL_FAVORITES,True); //使用该函数也可以,效果一样。
  ShowMessage(buffer);
end;

posted @ 2012-07-13 18:57  stma  阅读(194)  评论(0)    收藏  举报