掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
TedgeBrowser1でTargetBlankをクリックした時、TedgeBrowser1で表示をしたいのですが (ID:150562)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
最小構成は以下になります。 unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, uWVLoader, uWVWinControl, uWVWindowParent, uWVBrowserBase, uWVBrowser, Vcl.ExtCtrls; type TForm1 = class(TForm) Panel1: TPanel; Panel2: TPanel; WVBrowser1: TWVBrowser; WVWindowParent1: TWVWindowParent; Edit1: TEdit; Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure WVBrowser1AfterCreated(Sender: TObject); private { Private 宣言 } public { Public 宣言 } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin WVBrowser1.Navigate('https://www.google.com'); end; procedure TForm1.FormCreate(Sender: TObject); var ct:integer; begin WVWindowParent1.Browser:=WVBrowser1; if GlobalWebView2Loader.InitializationError then begin ShowMessage(GlobalWebView2Loader.ErrorMessage); end else begin ct:=0; while (ct<20) and (not GlobalWebView2Loader.Initialized) do begin sleep(500); Application.ProcessMessages; inc(ct); end; if GlobalWebView2Loader.Initialized then begin WVBrowser1.CreateBrowser(WVWindowParent1.Handle); end else begin ShowMessage('WebView2初期化失敗'); end; end; end; procedure TForm1.WVBrowser1AfterCreated(Sender: TObject); begin //以下必須 WVWindowParent1.UpdateSize; end; initialization // GlobalWebView2Loaderをロードして初期化 GlobalWebView2Loader := TWVLoader.Create(nil); //キャッシュやクッキー等の保存場所を指定する GlobalWebView2Loader.UserDataFolder := ExtractFilePath(Application.ExeName) + 'CustomCache'; GlobalWebView2Loader.StartWebView2; end.
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.