#line 1 until line 30 replaced by snippet
' ########################################################################################
' Microsoft Windows
' File: CW_WebView2.bas
' Contents: WebView2 example
' Compiler: FreeBasic 32 & 64 bit
' Copyright (c) 2025 José© Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#define _WIN32_WINNT &h0602
#include once "AfxNova/CWindow.inc"
#define _CWV2_DEBUG_ 1
#include once "AfxNova/CWebView2.inc"
#include once "AfxNova/CIniFile.inc"
USING Afxnova

declare function get_webrootpath() as DWstring
declare function get_webrootpuri() as DWstring

function get_webrootpath() as dwstring
   
DIM cIni AS CInifile = "AfxNovaWeb.ini"
    DIM wszName AS WSTRING * 260
    wszName = cIni.GetString("AfxNovaWeb", "Root")
    get_webrootpath=str(wszName)
end function

function get_webrootpuri() as dwstring
    DIM cIni AS CInifile = "AfxNovaWeb.ini"
    DIM wszName AS WSTRING * 260
    wszName = cIni.GetString("AfxNovaWeb", "PUri")
    get_webrootpuri=str(wszName)
end function

DECLARE FUNCTION wWinMain (BYVAL hInstance AS HINSTANCE, _
                           BYVAL hPrevInstance AS HINSTANCE, _
                           BYVAL pwszCmdLine AS WSTRING PTR, _
                           BYVAL nCmdShow AS LONG) AS LONG
   END wWinMain(GetModuleHandleW(NULL), NULL, wCommand(), SW_NORMAL)

' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

' ########################################################################################
' CWebView2NavigationCompletedEventHandlerImpl class
' Implementation of the ICoreWebView2NavigationCompletedEventHandler callback interface.
' ########################################################################################