TAdvWebBrowser OnInitialized no longer working on latest version of component

The following code no longer works and will not navigate to the url. On some of our older machine i have had to put a 3 second timer to get it to navigate after creation for it to work when before it worked fine using the oninitialized. This is using delphi 10.3

unit Unit1;

interface

uses

  • Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,*
  • Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvCustomControl, AdvWebBrowser, AdvWebBrowser.win;*

type

  • TForm1 = class(TForm)*
  • procedure FormCreate(Sender: TObject);*
  • procedure FormDestroy(Sender: TObject);*
  • private*
  • { Private declarations }*
  • DigiWebBrowserEdge: TAdvWebBrowser;*
  • procedure DigiWebBrowser1ContextPopup(Sender: TObject; MousePos: TPoint;var Handled: Boolean);*
  • procedure OnInit(Sender: TObject);*
  • public*
  • { Public declarations }*
  • end;*

var

  • Form1: TForm1;*

implementation

*{$R .dfm}

procedure TForm1.DigiWebBrowser1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
begin

  • Handled := True;*
    end;

procedure TForm1.FormCreate(Sender: TObject);
begin

  • DigiWebBrowserEdge := TAdvWebBrowser.Create(Self);*

  • TWinControl(DigiWebBrowserEdge).Parent := Self;*

  • DigiWebBrowserEdge.align := alClient;*

  • DigiWebBrowserEdge.AlignWithMargins := False;*

  • DigiWebBrowserEdge.HandleNeeded;*

  • DigiWebBrowserEdge.OnContextPopup := DigiWebBrowser1ContextPopup;*

  • DigiWebBrowserEdge.OnInitialized := OnInit;*

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin

  • FreeAndNil(DigiWebBrowserEdge);*
    end;

procedure TForm1.OnInit(Sender: TObject);
begin

end.

Thanks for any help
Lee

Set the OnInitialized event before setting the parent. You also should not call HandleNeeded

I have tried as you suggested and it is still not working. component version 1.3.3.1

procedure TForm1.FormCreate(Sender: TObject);
begin

  • DigiWebBrowserEdge := TAdvWebBrowser.Create(Self);*

  • DigiWebBrowserEdge.OnContextPopup := DigiWebBrowser1ContextPopup;*

  • DigiWebBrowserEdge.OnInitialized := OnInit;*

  • TWinControl(DigiWebBrowserEdge).Parent := Self;*

  • DigiWebBrowserEdge.align := alClient;*

  • DigiWebBrowserEdge.AlignWithMargins := False;*
    end;

Please attach the sample so we ca investigate this here

Hi attached project and exe

AdvWebbrowser Issue.zip (2.5 MB)

Thanks for the sample, we fixed the issue here, next version will address this.

Awesome Thankyoiu glad i could be of help