Dll 文件:shdocvw.dll
procedure DoOrganizeFavDlg(h:hwnd;path:pchar);stdcall;external ''shdocvw.dll'';
第二个参数指定收藏夹的位置,如果第二个参数为Nil的话,默认IE得收藏夹位置。
AddUrlToFavorites
DoAddToFavDlg
DoAddToFavDlgW
DoFileDownload
DoFileDownloadEx
DoOrganizeFavDlgW
SHAddSubscribeFavorite
SetShellOfflineState
SoftwareUpdateMessageBox
//添加到收藏夹
const
CLSID_ShellUIHelper: TGUID = ''{64AB4BB7-111E-11D1-8F79-00C04FC2FBE1}'';
var
ShellUIHelper: ISHellUIHelper;
url, title: Olevariant;
begin
url:=''www.csdn.net''
title:=''中国软件''
ShellUIHelper :=CreateComObject(CLSID_SHELLUIHELPER) as IShellUIHelper;
ShellUIHelper.AddFavorite(url, title);
end;
//整理收藏
var
H: HWnd;
p: procedure(Handle: THandle; Path: PChar); stdcall;
begin
H := LoadLibrary(PChar(''shdocvw.dll''));
if H <> 0 then
begin
p := GetProcAddress(H, PChar(''DoOrganizeFavDlg''));
if Assigned(p) then p(Application.Handle, PChar(favpath));
end;
FreeLibrary(h);
end;
---------
导出收藏夹
在VB中选择菜单的Project | References 选项,在References对话框中选择Microsoft Internet Controls项,然后在
程序中加入以下语句:
Dim dc As New SHDocVw.ShellUIHelper
dc.ImportExportFavorites False, "c:\a.html"
Set dc = Nothing
就可以将收藏夹导出到 c:\a.htm 中了,如果要从文件导入到收藏夹,只要将上面的False改为True,将"c:\a.html"改为要导入的文件名就可以了。