TLama

Untitled

Aug 1st, 2014
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.42 KB | None | 0 0
  1. type
  2.   TWebBrowser = class(SHDocVw.TWebBrowser, IDispatch)
  3.   private
  4.     function GetTypeInfoCount(out Count: Integer): HRESULT; stdcall;
  5.     function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HRESULT; stdcall;
  6.     function GetIDsOfNames(const IID: TGUID; Names: Pointer;
  7.       NameCount, LocaleID: Integer; DispIDs: Pointer): HRESULT; stdcall;
  8.     function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
  9.       Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HRESULT; stdcall;
  10.   end;
  11.  
  12. implementation
  13.  
  14. { TWebBrowser }
  15.  
  16. function TWebBrowser.GetIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HRESULT;
  17. begin
  18.   Result := inherited;
  19. end;
  20.  
  21. function TWebBrowser.GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HRESULT;
  22. begin
  23.   Result := inherited;
  24. end;
  25.  
  26. function TWebBrowser.GetTypeInfoCount(out Count: Integer): HRESULT;
  27. begin
  28.   Result := inherited;
  29. end;
  30.  
  31. function TWebBrowser.Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo,
  32.   ArgErr: Pointer): HRESULT;
  33. begin
  34.   if (Flags and DISPATCH_PROPERTYGET <> 0) and Assigned(VarResult) and
  35.     (DispId = DISPID_AMBIENT_DLCONTROL) then
  36.   begin
  37.     // here you don't specify DLCTL_BGSOUNDS control flag
  38.     PVariant(VarResult)^ := DLCTL_DLIMAGES or DLCTL_VIDEOS;
  39.     Result := S_OK;
  40.   end
  41.   else
  42.     Result := inherited;
  43. end;
Advertisement
Add Comment
Please, Sign In to add comment