如下代码就可以了。
TMyWebBrowser = class(TWebBrowser, IServiceProvider)
protected
function QueryService(const rsid, iid: TGuid; out Obj): HResult; stdcall;
end;
function TMyWebBrowser.QueryService(const rsid, iid: TGuid; out Obj): HResult;
const
IID_IDownloadManager: TGUID = (D1: $988934A4; D2: $064B; D3: $11D3; D4: ($BB, $80, $0, $10, $4B, $35, $E7, $F9));
begin
if IsEqualGuid(rsid, IID_IDownloadManager) then // 最好检查,是否装了 IE5.5 或更高
Result := S_OK else
Result := E_NOINTERFACE;
end;