这问题也太大了吧,给你看一段代码吧,就是读windows的ie收藏夹内容建立菜单
用了devexpress的devexbar,这个控件(www.51delphi.com有下载)就可以很容易地添加删除、拖动
//建立收藏夹菜单
procedure tfrmhtmlbrowser.addfavoritesmenu(baritem: TdxBarSubItem; favoritespath: string);
var
favoritefilename: string;
Search, src: TSearchRec;
subbaritem: Tdxbarbutton;
i, j: integer;
NewItemLink: TdxBarItemLink;
subitem: TdxBarSubItem;
begin
//生成目录
if findfirst(favoritespath + '/*.*', faArchive or faDirectory,
search) = 0 then
repeat
if (search.Name <> '.') and (search.Name <> '..') then
begin
subitem := TdxBarsubitem.Create(Self);
if (search.Attr and fadirectory) = fadirectory then
begin
subitem.Caption := ShortCaption(search.Name, 40);
subitem.ImageIndex := 2;
NewItemLink := baritem.ItemLinks.Add;
NewItemLink.Item := subitem;
addfavoritesmenu(subitem, favoritespath + '/' + search.Name);
end;
end;
until findnext(search) <> 0;
findclose(search);
//生成url文件
if findfirst(favoritespath + '/*.*', faArchive, src) = 0 then
repeat
subbaritem := TdxBarButton.Create(Self);
i := Pos('.LNK', uppercase(src.Name));
j := Pos('.URL', UpperCase(src.Name));
favoritefilename := favoritespath + '/' + src.Name;
subbaritem.Hint := GetFavoritesUrl(favoritefilename);
if (i <> 0) then
subbaritem.Caption := Copy(src.Name, 0, i - 1);
if (j <> 0) then
subbaritem.Caption := Copy(src.Name, 0, j - 1);
subbaritem.Caption := ShortCaption(subbaritem.Caption, 40);
subbaritem.ImageIndex := 3;
subbaritem.OnClick := menuclick;
NewItemLink := baritem.ItemLinks.Add;
NewItemLink.Item := subbaritem;
until findnext(src) <> 0;
findclose(src);
end; //end addfavoritesmenu