How to handle exception in the code when DLL missing/Edge corrupted for the AdvWebBrowser. example please...
You could check if the DLL can be loaded and if you can access the version. If so, then you can conclude the browser can be created
unit Unit14;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm14 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form14: TForm14;
implementation
{$R *.dfm}
uses
AdvUtils;
var
GetAvailableCoreWebView2BrowserVersionString: function(browserExecutableFolder: PWideChar; versioninfo: PPWideChar): HRESULT; stdcall;
procedure TForm14.Button1Click(Sender: TObject);
var
v: PWideChar;
h: HWND;
begin
h := LoadLibrary('WebView2Loader_x86.dll');
if (h = 0) then
Exit;
GetAvailableCoreWebView2BrowserVersionString := GetProcAddress(h, 'GetAvailableCoreWebView2BrowserVersionString');
v := '';
if Assigned(GetAvailableCoreWebView2BrowserVersionString) then
begin
GetAvailableCoreWebView2BrowserVersionString(nil, @v);
TAdvUtils.Log(v);
end;
end;
end.
Thanks Pieter, what is the minimum edge version to access the AdvWebBrowser.
The minimum version right now is version 104.0.1293.70: August 25, 2022. Typically, the browser also self updates so basically everyone that installs the runtime should more or less be on the latest version.
Ok Thanks. How to invoke AdvWebBrowser onclick event.
Events are currently not mapped. The browser is a native control that is hosted inside a wrapper component. We'll investigate the possibilities
Dropdown menu is creating problem when we load the web page on the windows web browser control. It is working fine when the window form is on fixed position, but when I tri to move the form, menu is gone out of the form and working fine on second time clicks the dropdown. Its working fine on the normal web browser control.
Please refer the attached screen.
According to this bug report (Select dropdown positioning · Issue #780 · MicrosoftEdge/WebView2Feedback · GitHub), it's something that needs to be handled in the browser, yet even when applying the proposed workarounds, we couldn't make the window disappear. We'll monitor this and see if we can find a workaround of our own or if the webview2 implements a better out of the box solution.