Mega Code Archive

 
Categories / Delphi / Forms
 

Display The Add to favorite Dialog Box

Title: Display The Add to favorite Dialog Box Question: How To Display The Add to favorite Dialog Box Answer: {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;