Internet - como mostrar a caixa de dialogo para salvar nos favoritos |
Top Previous Next |
// How To Display The Add to favorite Dialog Box // The Add to favorite dialog box is implemented in the "SHDocVw.DLL", the // folloing code enables you to interface that dialog with Delphi so you can // display it and add a favorite to the MSIE favorite list}
uses ComObj, SHDocVw;
function AddToFavoriteDlg(Title, URL: OLEVariant): Boolean; const CLSID_ShellUIHelper: TGUID = '{64AB4BB7-111E-11D1-8F79-00C04FC2FBE1}'; var ShellUIHelper: ISHellUIHelper; begin try if Url <> '' then begin ShellUIHelper := CreateComObject(CLSID_SHELLUIHELPER) as IShellUIHelper; ShellUIHelper.AddFavorite(url, title); end; Result := True; except Result := False; end; end;
procedure TForm1.Button1Click(Sender: TObject); begin AddToFavoriteDlg('melecon', 'htt://www.globo.com'); end; |