Retrieving HWND with using XAMLIsland, C++/WinRT, win32, UWP UserControl - FilePicker

583 Views Asked by At

I cannot for the life of me work this one out. I have a win32 app with a XAMLIsland that hosts a custom UWP UserControl using C++/WinRT. I am trying to use winrt::Windows::Storage::Pickers::FolderPicker and as such need to call picker.as()->Initialize(hwnd) before I can use the picker.

How do I get the HWND either inside of the usercontrol or passed from the win32 hosting app? I cannot for the life of me work this out. Any hints / tips would be incredibly useful.

I haven't posted the full source as the below is basically the same but without the picker: https://github.com/microsoft/Xaml-Islands-Samples/tree/master/Standalone_Samples/CppWinRT_Desktop_Win32App

0

There are 0 best solutions below