4 ms·
Here you go: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-host-controls https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/x...
by poizan42 8y ago
Here you go: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-host-controls https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/x...
- kodablah 8y agoI saw this as part of https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/index https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-a... (and the previous cppwinrt github project) but I haven't dug too deeply. I wonder if the restrictions are too limiting. Any bare-bones win32 example of using it in a simple cpp file? I plan on doing a poc myself soon.
- mastax 8y agoUsing WinRT stuff in a Win32 app is quite simple. Add windowsapp.lib, #include "winrt/Windows.Foundation.h", and call winrt::init_apartment();. There's no easy way to embed Xaml controls, though. I think the only option would be to have a separate Xaml window, get its HWND, and SetWindowLong+SetParent to force it to be a child window.
- poizan42 8y agoThere's this: Walkthrough: Hosting WPF Content in Win32[0] That does use C++/CLI though, but I'm sure you can play around with the embedded api if you really want a pure C++ solution. [0] https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/walkthrough-hosting-wpf-content-in-win32 https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanc...
- mastax 8y agoWPF ≠ UWP XAML, which is what the EdgeHTML control is.
- poizan42 8y agoWell, the controls in question here are WPF and WinForms hosts for UWP controls, so if you can host WPF then you can use the UWP host control to host UWP content. Yeah, its a bit roundabouts, but I think it is the only supported way right now.