In my Delphi 12.1 VCL Application in Windows 11 Pro 64-bit I need a browser to render remote web pages from the Internet. So I dropped a TEdgeBrowser on my form to test it:
PAS file:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Winapi.WebView2, Winapi.ActiveX,
Vcl.Edge;
type
TForm1 = class(TForm)
EdgeBrowser1: TEdgeBrowser;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
EdgeBrowser1.Navigate('https://www.example.com');
end;
end.
DFM file:
object Form1: TForm1
Left = 0
Top = 0
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
Caption = 'Form1'
ClientHeight = 664
ClientWidth = 938
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -18
Font.Name = 'Segoe UI'
Font.Style = []
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 144
TextHeight = 25
object EdgeBrowser1: TEdgeBrowser
Left = 0
Top = 0
Width = 938
Height = 664
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
Align = alClient
TabOrder = 0
AllowSingleSignOnUsingOSPrimaryAccount = True
TargetCompatibleBrowserVersion = '117.0.2045.28'
UserDataFolder = '%LOCALAPPDATA%\bds.exe.WebView2'
ExplicitLeft = 480
ExplicitTop = 360
ExplicitWidth = 150
ExplicitHeight = 60
end
end
I went to the Microsoft website:
https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section
and downloaded: MicrosoftEdgeWebview2Setup.exe
After running the Webview installer, it said:
When running my test application, it showed: Nothing!
What must I do to make this work?
WebView2Loader.dll
next to the exe. It did not work.