Application::Start replaces the main message loop
As it is a Win32 app, you can have access to the main window WndProc with SetWindowSubclass (for example in some samples I posted in C#, like in MainWindow.xaml.cs, where I needed to intercept particular messages)
I have this wWinMain in the C++ generated code :
int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
{
{
void (WINAPI *pfnXamlCheckProcessRequirements)();
auto module = ::LoadLibrary(L"Microsoft.ui.xaml.dll");
if (module)
{
pfnXamlCheckProcessRequirements = reinterpret_cast<decltype(pfnXamlCheckProcessRequirements)>(GetProcAddress(module, "XamlCheckProcessRequirements"));
if (pfnXamlCheckProcessRequirements)
{
(*pfnXamlCheckProcessRequirements)();
}
::FreeLibrary(module);
}
}
winrt::init_apartment(winrt::apartment_type::single_threaded);
::winrt::Microsoft::UI::Xaml::Application::Start(
[](auto&&)
{
::winrt::make<::winrt::WinUI3_CPP2::implementation::App>();
});
return 0;
}