Open
Description
The sample code described in the page is not working.
The sample's message pump is incorrect.
It should be something as:
auto xamlSourceNative2 = desktopSource.as<IDesktopWindowXamlSourceNative>();
while (GetMessage(&msg, nullptr, 0, 0))
{
BOOL messageProcessedByXaml = FALSE;
check_hresult(xamlSourceNative2->PreTranslateMessage(&msg, &messageProcessedByXaml));
if (!messageProcessedByXaml && !TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 896fef0f-20c1-4191-4f05-b330bc02e820
- Version Independent ID: c58a8006-f1f3-4345-d5fb-205b4c782320
- Content: Host a standard WinRT XAML control in a C++ desktop (Win32) app using XAML Islands - Windows apps
- Content Source: hub/apps/desktop/modernize/host-standard-control-with-xaml-islands-cpp.md
- Product: reunion
- Technology: apps
- GitHub Login: @Karl-Bridge-Microsoft
- Microsoft Alias: kbridge