Win32 message loop using P/Invoke in C#
Background I want to render some HTML inside a headless instance of the MS CoreWebView2 to a PNG file. The approach has to work inside a “pure” .Net8.0 console application on windows (e.g. <TargetFramework>net8.0-windows</TargetFramework>). Here is a condensed code sample showing my current approach: using Microsoft.Web.WebView2.Core; using System.Diagnostics; namespace UiThread { internal class Program { […]