Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 28-11-2021
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.142
Poder: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola a todos,

Dejo aquí una unidad que, con sólo añadirla al proyecto, añade lo necesario para "emular" Internet Explorer 11 en el componente WebBrowser: de este modo, al menos podría usarse esta última versión del explorador, que, ofrece ciertas mejoras, aunque, como he comentado arriba, hoy día, lo mejor sería plantearse utilizar el "WebView2" de Microsoft:

Código Delphi [-]

unit UBrowserFixes;

interface

type
  TBrowserFixes = class(TObject)
  public
    class procedure Initialize();
    class procedure Uninitialize();
  end;

implementation

uses
  // Delphi
  Windows,
  SysUtils,
  Registry;

const
  FEATURE_GPU_RENDERING_KEY = 'Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_GPU_RENDERING';
  FEATURE_BROWSER_EMULATION_KEY = 'Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION';

{ TBrowserFixes }

class procedure TBrowserFixes.Initialize();
var
  ExeName: string;
begin
  ExeName := ExtractFileName(ParamStr(0));
  with TRegistry.Create() do
  try
    RootKey := HKEY_CURRENT_USER;

    if OpenKey(FEATURE_BROWSER_EMULATION_KEY, True) then
    begin
      if not ValueExists(ExeName) then
      begin
        // http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
        WriteInteger(ExeName, 11001);
      end;
      CloseKey();
    end;

    if OpenKey(FEATURE_GPU_RENDERING_KEY, True) then
    begin
      if not ValueExists(ExeName) then
      begin
        // https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
        WriteInteger(ExeName, DWORD(1));
      end;
      CloseKey();
    end;

  finally
    Free();
  end;
end;

class procedure TBrowserFixes.Uninitialize();
var
  ExeName: string;
begin
  ExeName := ExtractFileName(ParamStr(0));

  with TRegistry.Create() do
  try
    RootKey := HKEY_CURRENT_USER;

    if OpenKey(FEATURE_BROWSER_EMULATION_KEY, False) then
    begin
      if ValueExists(ExeName) then
        DeleteValue(ExeName);
      CloseKey();
    end;

    if OpenKey(FEATURE_GPU_RENDERING_KEY, False) then
    begin
      if ValueExists(ExeName) then
        DeleteValue(ExeName);
      CloseKey();
    end;

  finally
    Free();
  end;
end;

initialization
  TBrowserFixes.Initialize();

finalization
  TBrowserFixes.Uninitialize();

end.
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Debuggeando en Delphi 10.1 Berlin Mteje Varios 2 09-05-2019 17:19:24
Problema con proyecto en Delphi Berlin newtron Varios 13 26-05-2017 20:09:26
Tamaño fuente en el IDE Delphi Berlin keys Varios 2 22-07-2016 08:08:48
Error al instalar C++ builder berlin BDWONG Varios 2 21-06-2016 17:21:04


La franja horaria es GMT +2. Ahora son las 20:08:39.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi