TWebView2

Source: source/classes/twebview2.prg

Overview

TWebView2 embeds Microsoft Edge WebView2 in a FiveWin window or dialog. Use it to host modern HTML/CSS/JS UIs next to native FWH controls. Requires the WebView2 Runtime (Evergreen or Fixed Version).

Desktop + Web with one UI

Sample samples/DesktopWeb/login.prg shows a full pattern where desktop and browser share the same HTML/CSS/JS:

// Desktop shell (simplified)
StartHttpServer( 8080 )
oWeb := TWebView2():New()
oWeb:Navigate( "http://localhost:8080/" )
oWeb:Run()

Build with multi-thread VM: samples\DesktopWeb\build.bat or build_new.bat login hm64 -mt. Demo users: admin/1234, demo/demo.

Key methods

For Remote View + WebView2 together, see samples/RemoteView/testrvweb.prg and Remote View.

See Classes Alphabetical for full class list.

See Also